in reply to Opening a File from the Command Line

You may also see something like this:

while (<>) {

That thing -> <> is called the 'diamond operator', and it assumes all the words entered on the command line are file names. It then combines all the files into one big file and reads one line at a time.

Replies are listed 'Best First'.
Re^2: Opening a File from the Command Line
by FunkyMonk (Bishop) on Apr 07, 2010 at 00:17 UTC
    [the diamond operator] assumes all the words entered on the command line are file names
    No it doesn't. The diamond operator will read from all the elements of @ARGV as if they are files. That may, or may not, be the same as the command line arguments.
    It then combines all the files into one big file
    No, it doesn't do that either. It reads each file line by line, setting $ARGV to the name of the file currently being read.

    See I/O operators for <>, @ARGV and $ARGV for further reading.