in reply to Re^5: reading files to different output files.
in thread reading files to different output files.

the input file should come from the command line. i don't want to determine the file within the script. Doesn't <> within the while loop open the files the users enters in the command line? If not, how can i implement the open command in my script?
  • Comment on Re^6: reading files to different output files.

Replies are listed 'Best First'.
Re^7: reading files to different output files.
by shmem (Chancellor) on May 28, 2017 at 16:16 UTC
    Doesn't <> within the while loop open the files the users enters in the command line?

    Yes, and there's more to it. Read about the null filehandle in I/O Operators, there's much to learn about @ARGV, $ARGV and ARGV, all three being "magical".

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
Re^7: reading files to different output files.
by marinersk (Priest) on May 28, 2017 at 21:53 UTC

    shmem's guidance is spot on, as usual. Be careful about command line filenames with wildcards, as these are handled differently in Windows vs. Linux.