in reply to First post, file handle question

It is opening a pipe to read the output of the unix cat command followed by the parameters passed on the command line, joined by a space. So if you do myscript foo bar, it will read the output from the unix-like command cat foo bar and process it.

Be aware that this is not the best way to do this. If I were to pass the following arguments /dev/null; echo rm -rf /; echo Gotcha! (but properly quoted and removing the first echo), your application would do much more than you wanted it to do. It would run the set of unix commands cat /dev/null; echo rm -rf /; echo Gotcha and give you the output from that (again, remove the echo from the rm command).

--MidLifeXis

Replies are listed 'Best First'.
Re^2: First post, file handle question
by Anonymous Monk on Apr 17, 2013 at 19:35 UTC
Re^2: First post, file handle question
by happyperl (Initiate) on Apr 17, 2013 at 19:38 UTC
    So instead of putting all the command line argument files into a single file before going into this perl script, this lines execute the cat command inside a perl? I got that.