Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ivorw (5222)

  (email not shown publicly)

Journal of ivorw (5222)

Sunday June 12, 2005
02:11 PM

fixin them shebangs

[ #25163 ]

I have a machine with several different versions of perl on it. In particular, the default one I am wanting it to use for the present is /home/knoppix/ivor/stable/bin/perl

This was a relatively freshly built perl, and I found that none of the scripts worked, as they were looking for a perl in /usr/local/bin/perl - I deliberately did not put one there; the O/S supplied one was in /usr/bin/perl.

This prompted me to look into how scripts get installed. I found that has a method call fixin which becomes available through inheritance as ExtUtils::MY->fixin. Just pass in some paths of perl scripts as parameters, and they get shebangled - that's if they have a shebang line.

You can do this from the command line, in a similar fashion to how make does with exe_files:

perl -MExtUtils::MY -e 'MY->fixin(@ARGV)' *.pl

I've also tracked through to the Config, where it gets the information about what to put into the shebang line. This is in $Config{startperl}. If you want the scripts to be shebanged to somewhere exotic when you install them, hack or edit (and remake your perl) to set startperl to be the correct place. You might also need to tweak perlpath in a similar way.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.