in reply to Naming file handles with variables?

Perl has got a command line option '-n' that supports multiple file processing at the same time. Here $_ will have each line. This option is much faster than using a FileHandle for the cases where the number of files are not known. Look for -n option on command line.
  • Comment on Re: Naming file handles with variables?

Replies are listed 'Best First'.
Re^2: Naming file handles with variables?
by Bloodnok (Vicar) on Apr 30, 2009 at 13:43 UTC
    No, not quite - from perlrun, we see:
    -n causes Perl to assume the following loop around your program, which ma +kes it iterate over filename arguments somewhat like sed -n or awk:.. +.
    Since it [the -n option] causes perl to iterate over the files in turn, self-evidently doesn't meet the requirements of the OP.

    A user level that continues to overstate my experience :-))