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 1013023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:02:03+00:00 2026-05-16T10:02:03+00:00

I’ve installed the Template module via CPAN on my MacBook Pro and it seemed

  • 0

I’ve installed the Template module via CPAN on my MacBook Pro and it seemed to install correctly.

But, when I try to run a script that includes the Template module, I get the following:

Can’t locate Template.pm in @INC (@INC contains: /Users/purinkle/Sites/rob/modules /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 ./index.pl line 12.

BEGIN failed–compilation aborted at ./index.pl line 12.

I then think that something must have gone wrong during installation and try to install again via CPAN but receive the following message:

Template is up to date (2.22).

I’ve then ran the instmodsh command to try and find where the module is installed. instmodsh lists these directories:

/opt/local/bin

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Template

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Template/Manual

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Template/Namespace

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Template/Plugin

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Template/Stash

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Template/Tools

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/Template/Tutorial

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/Template/Stash/XS

/opt/local/share/man/man1

/opt/local/share/man/man3

It looks like I have some how got two different versions of Perl installed (5.8.9 and 5.10.0) and this is causing confusion between CPAN and other Perl scripts.

How can I verify this and how can this issue be resolved?

I’ve ran the commands

which perl
which cpan

and they both return /opt/local/bin

Running

find / -name perl

returns

find: /dev/fd/3: Not a directory

find: /dev/fd/4: Not a directory

/opt/local/bin/perl

/opt/local/etc/bash_completion.d/perl

/opt/local/var/macports/software/bash-completion/1.2_0/opt/local/etc/bash_completion.d/perl

/opt/local/var/macports/software/perl5.8/5.8.9_3/opt/local/bin/perl

/opt/local/var/macports/sources/rsync.macports.org/release/ports/perl

/usr/bin/perl

/usr/local/bin/perl

/usr/share/file/magic/perl

and

find / -name cpan

returns

/opt/local/bin/cpan

/opt/local/var/macports/software/perl5.8/5.8.9_3/opt/local/bin/cpan

/Users/purinkle/.cpan/build/CPAN-1.9402-KtN827/blib/script/cpan

/Users/purinkle/.cpan/build/CPAN-1.9402-KtN827/scripts/cpan

/Users/purinkle/.cpan/build/CPAN-1.9402-zb0AeX/blib/script/cpan

/Users/purinkle/.cpan/build/CPAN-1.9402-zb0AeX/scripts/cpan

/usr/bin/cpan

Running

perl -e 'print join "\n", @INC'

returns

/Users/purinkle/Sites/rob/modules

/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level

/opt/local/lib/perl5/site_perl/5.8.9

/opt/local/lib/perl5/site_perl

/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level

/opt/local/lib/perl5/vendor_perl/5.8.9

/opt/local/lib/perl5/vendor_perl

/opt/local/lib/perl5/5.8.9/darwin-2level

/opt/local/lib/perl5/5.8.9

  • 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-16T10:02:04+00:00Added an answer on May 16, 2026 at 10:02 am

    OS X ships with two versions of Perl. 5.10.0 is the default, so /usr/bin/perl and /usr/bin/cpan should all talk to 5.10.0.

    The problem is you have three. /opt/local indicates a MacPorts installation which probably installed Perl as a dependency when you weren’t looking. That’s /opt/local/bin/perl and its probably the default perl in your path. Check with which perl. That also means you’re probably using MacPorts’ cpan, check with which cpan, and thus installed Template Toolkit into the MacPorts version.

    I’m going to guess either you’re running a program with #!/usr/bin/perl at the top or you’re using the built in mod_perl or you’re running it as a user who is not you. All of which will reference OS X’s default Perl and not your MacPorts install.

    Macports has a 5.10 as well as 5.12, but “perl” in Macports is still 5.8. You can install 5.10 in Macports.

    As to how to resolve this… if you’re using using mod_perl on that machine, use Macports’ Perl. It will be easier to install modules and it will be kept up to date better than the OS version.

    To shield yourself from future confusion, you can add aliases into /usr/local/bin or ~/bin to perl, perldoc and cpan to the Perl of your choice. That will prevent something else from installing perl in your path and hijacking.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.