As far as I know the answer is no. I you think about @INC you will know you can not change it once Perl is built althought Perl does provide a mechanism to modify it on a script by script basis.
I would just move the scripts and build Perl where you want it. This little script will "re-shebang" them as required. It will retain all the existing -wT type flags. It does all the scripts that end in .pl or .cgi under the $root_dir.
#!/usr/bin/perl -w use strict; use File::Find; my $root_dir = '/temp'; my $new_shebang = '#!/usr/bin/local/perl'; find ( \&fix_shebang, $root_dir ); sub fix_shebang { return unless /\.(?:pl|cgi)/; local $/; open F, "+<$_" or die "Can't open $_: $!\n"; my $file = <F>; if ($file =~ s/^#!.*perl(.*)\n/$new_shebang$1\n/) { seek F, 0, 0; truncate F, 0; print F $file; print "Found and modified: $File::Find::name\n"; } else { print "Found (no modify): $File::Find::name\n"; } close F; }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Re: Re: Changing locations of Perl builds on different machines
by tachyon
in thread Changing locations of Perl builds on different machines
by MadraghRua
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |