Stories
Slash Boxes
Comments
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)

ivorw
  (email not shown publicly)
http://myweb.tiscali.co.uk/ivorw

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 ExtUtils::MM_Unix.pm 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 Config.pm or edit config.sh (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.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.