in reply to perl script used as sh-bang

Minor note, you probably mean $0 up there, not $ARGV[0]. This is not a pip^H^H^Hc program :)

Replies are listed 'Best First'.
Re^2: perl script used as sh-bang
by K_M_McMahon (Hermit) on Jan 22, 2005 at 19:39 UTC
    Pardon my stupidity, but in the above example, since the print "$ARGV[0]\n"; # the name of the real file ? is in the script 'sli.pl' wouldn't replacing it with $0 actually return 'sli.pl'?
      You are correct; I was under the impression that was what the OP wanted. Now I'm not sure :)

      The shebang mechanism does put the interpreted script in argv[1] (to use the common c name), so yes, if what's mean by "real file" is the file in the target language, $ARGV[0] should be used in the interpreter.