Hello, total newbie here, maybe 50 lines of perl in my life. I really
appreciate any pointers. I have hit a research wall on this one.
I am working on trying to create a portfile for MacPorts for ASSP.
MacPorts is just a package manager for OS X. There are a few things
that are probably important to know.
MacPorts installs a new perl, in /opt/local/bin/perl
MacPorts puts everything in /opt/local/
ASSP required about 15 perl modules, I installed them, or wrote new
portfiles for them to get them installed. I have all requirements for
ASSP installed. I edit the ASSP source files to change the first line
from:
#!/usr/bin/perl --
to
#!/opt/local/bin/perl --
When I run ASSP, it tells me three ports are not installed. One is
Email::Valid, which should serve well enough as a way for me to learn
how to solve this.
I think this has to do with the @INC path. I can not add to PERL5LIB
environment variable, since that is outside of /opt/local/ and would
require user permission to change the file.
What I am not understanding, is why these three perl mods are not
finding the correct location. ASSP is running perl from /opt/local/
since it found the other 12 modules, but it misses 3 of them. Since I
did not have to modify @INC to get it to find the 12, what is causing
the 3 others to not be found?
I have searched the ASSP source to find a hard coded path, the module
check looks like a looped array check with no special treatment to any.
Is it something in the source of Email::Valid that is making an
assumption on path location?
I made a small test file to prove that Email::Valid was working..
use Email::Valid;
print (Email::Valid->address('maur...@hevanet.com') ? 'yes' : 'no');
run as `perl testfile.pl` it will fail, with error that it can not
find email valid
run as `/opt/local/bin/perl testfile.pl` it works.
So this proves to my limited understanding, that changing the path to
perl should be all I need to do.
I can use
use lib "/path/to/directory"
in the ASSP code, but I would like to avoid live manipulation of the
ASSP source, unless it really is needed.
I believe it is in the correct location:
/opt/local/lib/perl5/vendor_perl/5.8.9/Email/Valid.pm
The output of @INC below shows that is a path that is being searched.
For reference, using `perl` plain, this is the result
perl -e "print join(\"\n\", @INC);"
/System/Library/Perl/5.8.8/darwin-thread-multi-2level
/System/Library/Perl/5.8.8
/Library/Perl/5.8.8/darwin-thread-multi-2level
/Library/Perl/5.8.8
/Library/Perl
/Network/Library/Perl/5.8.8/darwin-thread-multi-2level
/Network/Library/Perl/5.8.8
/Network/Library/Perl
/System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.8.8
/Library/Perl/5.8.6
/Library/Perl/5.8.1
Using the /opt/local/ path, this is the result
/opt/local/bin/perl -e "print join(\"\n\", @INC);"
/opt/local/lib/perl5/5.8.9/darwin-2level
/opt/local/lib/perl5/5.8.9
/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
Thanks for any help and education you may offer.
--
Scott
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/