On Feb 22, 2007, at 6:21 PM, Vic Norton wrote:

Apple suggested I install something the other day. (Java or something like that.) I did it. Now I discover that many of my Perl scripts don't work.

The problem is with @INC. It appears to have been upgraded to Perl 5.8.8. For example, when I try
   use Date::Parse qw(str2time);
I get the message
/Volumes/VTN Docs/ My Perl/Tests/test5.pl:6: Can't locate Date/ Parse.pm in @INC
followed by a list of what @INC contains:
   /Volumes/VTN Docs/ My Perl/Tests
   /usr/local/lib/perl5/5.8.8/darwin-2level
   /usr/local/lib/perl5/5.8.8
   /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level
   /usr/local/lib/perl5/site_perl/5.8.8
   /usr/local/lib/

That's not Apple's Perl, or anything that resulted from the recent Apple update. I've looked through the recent Apple update receipts, and didn't find anything Perl-related. You can use lsbom to check the contents of anything installed from .pkg or .mpkg packages, which includes Apple updates. The receipts are in /Library/Receipts, so to find the.boms for packages installed in the last 7 days:

        find /Library/Receipts -newerct '7 days ago' -name '*.bom'

Then, to browse the list of files installed by a package using the "less" command:

lsbom /Library/Receipts/JavaForMacOSX10.4Release5.pkg/Contents/ Archive.bom | less

The package "Date/Parse.pm" is right where it has always been, along with a whole pile of other stuff, in
   /Library/Perl/5.8.6

So this is my question. How do I add "/Library/Perl/5.8.6" to @INC, without having to add
   use lib "/Library/Perl/5.8.6";
to every script ?

Possibly, someone replaced all your scripts #!/usr/bin/perl with #!/ usr/local/bin/perl. Maybe you did that to test them against the newer Perl and forgot to change it back, or maybe someone in your house has a strange sense of humor. :-)

If your scripts still say #!/usr/bin/perl, then something has removed the original /usr/bin/perl and replaced it with a link to /usr/local/ bin/perl. You can check that with "/usr/bin/perl -v".

Fortunately, the original is also a link, to /usr/bin/perl5.8.6, so if it was disturbed, it's easy to make things right:

        sudo rm /usr/bin/perl
        sudo ln /usr/bin/perl5.8.6 /usr/bin/perl

sherm--

Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


Reply via email to