On Jan 22, 2009, at 10:54 PM, Raymond Wan wrote:
Scott Haneda wrote:
ASSP installed. I edit the ASSP source files to change the first line from:
#!/usr/bin/perl --
to
#!/opt/local/bin/perl --

...

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.

I'm not much of a Mac user, so perhaps this is not too helpful,

Thanks for the help. It really should not matter, these issues should not be Mac specific, I only mentioned it since the reason I am in this mess is because I want to make a port file for a package manager that happens to be for the Mac.

but one thing you might want to check is if all these perl's are the same executables. I think "perl --version" will do it. Check that these are all the same:

/usr/bin/perl --version
/opt/local/bin/perl --version
perl --version

I tried those a while back, just to see where I was at. The first one will show me the results of the Apple installed perl, the second the results of my Mac Ports based install, and the third, will fall back on my default environment $PATH variable and use /usr/bin/perl. I will include them for the sake of clarity...

/usr/bin/perl -V
http://pastebin.com/f7ab6a673

/opt/local/bin/perl -V
http://pastebin.com/f37ebab96

And of course, the `perl -V` yields the same results as the first link.

As you can see, the /opt/local/perl lists the @INC paths, and 100% of them are in /opt/local so why when I use #!/opt/local/bin/perl -- for the interpreter in a script, does that script run around and use other locations?

They most likely aren't the same and if so, the problem is just that the modules you want (Email::Valid, etc.) have been installed for one version and not the other.

Correct. The modules I want are not installed in /usr/bin/perl, they are in /opt/local/bin/perl the problem is that 12 of the modules in / opt/bin/perl are being used, and of them are not. I can not determine why three are being excluded.

I am going to add /opt/local/bin to my $PATH as the first item, and test that, just for kicks.

Multiple versions of perl can co-exist, of course. So, if you do find an old one, you don't need to uninstall it.

So is it correct, that is I use /opt/local/bin/perl as the interpreter in a script, it should only use the modules that @INC reports for -V ?

Personally, I always thought for a particular version, you should use the libraries that have been installed for that version. i.e., if you are using 5.8.8, then you should use 5.8.8's libraries. But, I could be wrong about that...

That is exactly what I am doing, aside from modules that were not included with it, I of course had to build and install those on my own, but I pointed their destination to /opt
--
Scott


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to