Note that there are some explanatory texts on larger screens.

plurals
  1. POCant run some perl scripts from Textmate (Can't locate in @INC error)
    primarykey
    data
    text
    <p>I primarily use Textmate for perl hacking on OSX Snow Leopard. It was all fine till some days ago when I installed Macports (I've heard a rumor that macports installs some version of perl in /opt/local). Now, for any new package that I install from CPAN, and try to use if from Textmate, it gives me an error like this when I hit Cmd+R to run it (I had installed HTML::TreeBuilder from CPAN moments before):</p> <pre><code>Can't locate HTML/TreeBuilder.pm in @INC (@INC contains: /Applications/TextMate.app/Contents/SharedSupport/Bundles/Perl.tmbundle/Support /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /workspace/PerlScripts/test.pl line 2. </code></pre> <p>However it runs just fine when I run it from command line. If you will notice, textmate is using Perl version 5.10.0. When I run a "Perl -v" from command line, it shows me the version as 5.12.3 (see a copy paste from terminal below)</p> <pre><code>This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-multi-2level </code></pre> <p>The small perl code that I used is this:</p> <pre><code>#!/usr/bin/env perl &lt;br/&gt; use HTML::TreeBuilder; &lt;br/&gt; print $HTML::TreeBuilder::VERSION."\n";&lt;br/&gt; print "$INC{'HTML/TreeBuilder.pm'}\n";&lt;br&gt; </code></pre> <p>Then I ran "which perl" from command line and it returned this:</p> <pre><code>/opt/local/bin/perl </code></pre> <p>then I ran "print system("which perl");" from Textmate and it returned </p> <pre><code>/usr/bin/perl </code></pre> <p>Now I clearly have two versions of perl sitting in my system. 5.10.0 that Textmate is trying to refer to and which cannot see my CPAN installs. And 5.12.3 that looks to be the default version of perl when I run it from command line and the one which my CPAN installs to. I tried to replace this:</p> <pre><code>#! /usr/bin/perl -w </code></pre> <p>with this (had read on google that this will force the system default perl to be picked up in textmate):</p> <pre><code>#!/usr/bin/env perl </code></pre> <p>No dice yet. Textmate still gives me the same error as I mentioned at the start of the question. So, is there a way to get it to work with Textmate? And is there a way to make textmate point to version 5.12.3?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload