[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Script interpreter locations



I agree that specifying the location in Linux does not directly help
portability to other OSes running perl, however it may help
to encourage other OSes that ship it to put it in the same place.
[UnixWare 7 ships with perl in /usr/bin/perl (a symlink to
the actual location)].

In perl you can get around the location by
using an exec at the top of the script , something along the lines of

eval 'exec perl -S $0 "$@"'
    if $running_under_some_shell;
                        # this emulates #! processing

eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
                        # process any FOO=bar switches

regards
Andrew


Reply to: