Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7071723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:43:20+00:00 2026-05-28T05:43:20+00:00

I primarily use Textmate for perl hacking on OSX Snow Leopard. It was all

  • 0

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):

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.

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)

This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-multi-2level

The small perl code that I used is this:

#!/usr/bin/env perl <br/>
use HTML::TreeBuilder; <br/>
print $HTML::TreeBuilder::VERSION."\n";<br/>
print "$INC{'HTML/TreeBuilder.pm'}\n";<br>

Then I ran “which perl” from command line and it returned this:

/opt/local/bin/perl

then I ran “print system(“which perl”);” from Textmate and it returned

/usr/bin/perl

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:

#! /usr/bin/perl -w

with this (had read on google that this will force the system default perl to be picked up in textmate):

#!/usr/bin/env perl

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:43:20+00:00Added an answer on May 28, 2026 at 5:43 am

    You need to set the relevant environment variables for OS X. At the moment you probably have them set just for your shell. These will probably be PATH and PERL5LIB.

    mkdir ~/.MacOSX
    touch ~/.MacOSX/environment.plist
    defaults write ~/.MacOSX/environment VARIABLE_NAME VARIABLE_VALUE
    

    You’ll need to log out and back in again to activate it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently use Strawberry Perl as my primary Perl distribution. However, I have some
I'm trying to decide on whether to primarily use floats or ints for all
Recently I've been craving some game programming. I primarily use Linux, and was wondering
We primarily use an ASP.NET environment at work. Right now I'm building an application
I use Emacs primarily for coding Python but sometimes I use IDLE. Is there
I've recently purchased a Mac and use it primarily for C# development under VMWare
my primary language is spanish, but I use all my software in english, including
I primarily use NInject as my IoC container, and is very happy with it
For my client side development I use MooTools primarily, I have also just recently
I primarily use Visual Studio and ReSharper (R#) for development and have excellent working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.