in reply to Re:x2 'perl -p' ne 'cat'
in thread 'perl -p' ne 'cat'
Which only begs the question why does it work when -p is placed on the shebang line of a script, as opposed to needing -e 1 when used on a command line?
For the same reason you *never* need -e if you run the program from a file - either by using the shebang line, or by doing perl program.
Perl uses the following strategy to find the program:
You might say, what about the shebang line? The shebang line is handled by the kernel - the interpreter found on the shebang line is started, and the content of the file (including the shebang line) is passed on STDIN. (This also explains why such interpreters always use # as the start of the comment).
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re:x2 'perl -p' ne 'cat'
by Juerd (Abbot) on Jun 04, 2002 at 09:55 UTC |