in reply to Re^3: @ARGV while (<>) hangs
in thread @ARGV while (<>) hangs

I see what your saying. I'll check to make sure that nothing except a legitimate filename is being passed as $in_file. However, may I ask what you mean by "<> (and thus the 2-arg open) instead of the safer 3-arg open"?

Replies are listed 'Best First'.
Re^5: @ARGV while (<>) hangs
by alexm (Chaplain) on Jan 09, 2008 at 18:29 UTC
Re^5: @ARGV while (<>) hangs
by ikegami (Patriarch) on Jan 09, 2008 at 21:48 UTC
    <> uses the 2-arg open, which combines the "mode" with the file name. It allows pipes to be specified and thus the script can be used to execute arbitrary commands. That may makes sense for some command line tools, but not in general. When using the 3-arg open, the mode and the file name are kept seperate, so an arbitrary command cannot be sneaked in. Seperation of code and data is always safer.