perl5.8 problem?

Kurt Hillig khillig at umich.edu
Fri Jul 11 05:42:35 PDT 2008


After more testing it looks like I gave you some bad advice.

On the one hand, it should be 'use Mac::Files;', not 'use Files;', but on 
the other I haven't been able to get this to work with either 'use lib 
<directory>' or with '-I<directory>' on the command line.

So it looks like something is needed when Perl is compiled that's missing 
in the Macports version - which makes sense, given the Macports philosophy 
of not using anyting that Macports didn't build.

What does work (in my testing) is to use the native Perl rather than the 
Macports Perl - i.e. start your script with:

 	#!/usr/bin/perl

instead of

 	#!/opt/local/bin/perl

(or invoke it with '/usr/bin/perl <script>' rather than 'perl <script>', 
assuming /opt/local/bin preceeds /usr/bin in your path).

This may mean that you'd have to do something like this if you want to use 
any Macports-generated Perl modules:

 	use lib '/opt/local/lib/perl5/5.8.8';
 	use <perl module name>;

I suspect it would also work if you created symlinks to the native modules 
in the appropriate places within the /opt/local/lib/perl5 directory tree; 
but this isn't exactly maintainable...

                             Dr. Kurt Hillig
   UMNet Administration     I always tell the    Fax (734)763-4050
  University of Michigan     absolute truth,    Phone (734)647-8778
Ann Arbor, MI  48105-3640    as I see it.   EMail khillig(at)umich.edu

  > Computers were invented to help people waste more time faster <

On Thu, 10 Jul 2008, Shawn Protsman wrote:

> That sounds like a reasonable suggestion. Unfortunately I still got an error. 
> I added the following two lines to my perl script:
>
> use lib '/System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/Mac';
> use Files;
>
> Running the script results in the following:
>
> @naiad ~/workspace/aestTest] ./aestTest --CbcDec
> Can't locate loadable object for module Mac::Files in @INC (@INC contains: 
> /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/Mac 
> /opt/local/lib/perl5/5.8.8/darwin-2level /opt/local/lib/perl5/5.8.8 
> /opt/local/lib/perl5/site_perl/5.8.8/darwin-2level 
> /opt/local/lib/perl5/site_perl/5.8.8 /opt/local/lib/perl5/site_perl 
> /opt/local/lib/perl5/vendor_perl/5.8.8/darwin-2level 
> /opt/local/lib/perl5/vendor_perl/5.8.8 /opt/local/lib/perl5/vendor_perl .) at 
> ./aestTest line 17
> Compilation failed in require at ./aestTest line 17, <DATA> line 1.
> BEGIN failed--compilation aborted at ./aestTest line 17, <DATA> line 1.
>
> Here is what is inside the directory:
>
> @naiad ~/workspace/aestTest] ls 
> /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/Mac
> AppleEvents.pm*     Files.pod           Memory.pod          OSA.pod 
> Sound.pod
> AppleEvents.pod     Gestalt.pm          MoreFiles.pm        Processes.pm 
> Speech.pm
> Carbon.pm           Gestalt.pod         MoreFiles.pod       Processes.pod 
> Speech.pod
> Components.pm       InternetConfig.pm   Notification.pm     Resources.pm 
> Types.pm
> Components.pod      InternetConfig.pod  Notification.pod    Resources.pod 
> Types.pod
> Files.pm            Memory.pm           OSA.pm              Sound.pm
>
>
>
> On Jul 10, 2008, at 10:21 AM, Kurt Hillig wrote:
>
>> Perl uses '@INC' to hold the list of directories to be searched for modules 
>> that you might use; the default '@INC' in the MacOSX native Perl (on my 
>> 10.4 box) is:
>> 
>> /System/Library/Perl/5.8.6/darwin-thread-multi-2level
>> /System/Library/Perl/5.8.6
>> /Library/Perl/5.8.6/darwin-thread-multi-2level
>> /Library/Perl/5.8.6
>> /Library/Perl
>> /Network/Library/Perl/5.8.6/darwin-thread-multi-2level
>> /Network/Library/Perl/5.8.6
>> /Network/Library/Perl
>> /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
>> /System/Library/Perl/Extras/5.8.6
>> /Library/Perl/5.8.1/darwin-thread-multi-2level
>> /Library/Perl/5.8.1
>> 
>> When you install the MacPorts Perl, you get a different @INC (as your 
>> messages shows); but Files.pm isn't in any of those locations.
>> 
>> I'm no Perl expert, but one workaround is to do something like this to your 
>> code:
>>
>> 	use lib '/Library/Perl/5.8.6/darwin-thread-multi-2level/Mac';
>> 	use Files;
>> 
>> (at least on my box, that's where I found Files.pm)
>>
>>                           Dr. Kurt Hillig
>> UMNet Administration     I always tell the    Fax (734)763-4050
>> University of Michigan     absolute truth,    Phone (734)647-8778
>> Ann Arbor, MI  48105-3640    as I see it.   EMail khillig(at)umich.edu
>> 
>>> Computers were invented to help people waste more time faster <
>> 
>> On Thu, 10 Jul 2008, Shawn Protsman wrote:
>> 
>>> I was using the OS X version of Perl and haven't had any issues. Then
>>> I installed git-core which has a perl5.8 dependency. Now that the
>>> Macport perl5.8 is on my system I cannot run some of my perl programs.
>>> Here is an example:
>>> @naiad ~/workspace/aestTest] ./aestTest --CbcDec
>>> Can't locate Mac/Files.pm in @INC (@INC contains: /opt/local/lib/
>>> perl5/5.8.8/darwin-2level /opt/local/lib/perl5/5.8.8 /opt/local/lib/
>>> perl5/site_perl/5.8.8/darwin-2level /opt/local/lib/perl5/site_perl/
>>> 5.8.8 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/
>>> 5.8.8/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.8 /opt/local/
>>> lib/perl5/vendor_perl .) at /opt/local/lib/perl5/site_perl/5.8.8/File/
>>> HomeDir/Darwin.pm line 34.
>>> 
>>> Next, I try to start cpan to install Mac::Files:
>>> 
>>> @naiad ~/workspace/aestTest] cpan
>>> CPAN: File::HomeDir loaded ok (v0.80)
>>> Can't locate Mac/Files.pm in @INC (@INC contains: /opt/local/lib/
>>> perl5/5.8.8/darwin-2level /opt/local/lib/perl5/5.8.8 /opt/local/lib/
>>> perl5/site_perl/5.8.8/darwin-2level /opt/local/lib/perl5/site_perl/
>>> 5.8.8 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/
>>> 5.8.8/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.8 /opt/local/
>>> lib/perl5/vendor_perl /Users/sprotsman/workspace/aestTest) at /opt/
>>> local/lib/perl5/site_perl/5.8.8/File/HomeDir/Darwin.pm line 58.
>>> 
>>> Uhg! I'm running Mac OS 10.5.4 and Macports 1.6.0. Any help is much
>>> appreciated.
>>> _______________________________________________
>>> macports-users mailing list
>>> macports-users at lists.macosforge.org
>>> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>
>
> !DSPAM:4876b21e70371336712104!
>
>
>


More information about the macports-users mailing list