http://www.perlmonks.org?node_id=1200039

cristofayre has asked for the wisdom of the Perl Monks concerning the following question:

My shared server has the usual "!#/usr/bin/perl" for use by everyone, but personal installations appear to go into "perl/usr/lib/perl5" folder.

So if my scripts access the former, all is well. But to access the latter ...??? Have I got to change all my scripts to the new path of "!# perl/usr/lib/perl5" or is there a way to 'force' the new path into @inc. How would you do it if some "use xxx" are in /usr/bin/perl, and some in the second folder?

Did my last host use a "symlink" for this, and if so, where did he put it.

Finally, if the "use" entry could not be found, would this generate a "suexec violation" error? A script using "File::Find::Rule", permission 755 designed to update all the file permissions came back with the above for a 500 error. I asked host, and their response: "Please set all your perl files to 755" (In otherwords, they had no idea!)

This is the script:

#!/usr/bin/perl print "content-type: text/html\n\n"; # use CGI::Carp qw( fatalsToBrowser ); use File::Find::Rule; my @files = File::Find::Rule->file()->name('*.pl')->in('/home/cristofa +/public_html'); # set ->in('.') to start from current directory for ($x=0; $x<@files; $x++){ chmod (0755, $files[$x]); print "$files[$x]&lt;br&gt;"; } print "All done";

# CARP is commented out because - whilst CGI is installed - it doesn't specifically list CGI::CARP. I installed the latter ... which comes back to the initial "perl5" path query! Script works on my Windows / Strawberry perl version.

And yes, I know you CAN use a foreach / while loop ... but I still find that a bit 'symbolic' and prefer to 'see' what's happening each loop.