http://www.perlmonks.org?node_id=22099


in reply to how can I input different files as an argument while I am running my perl program?

When you run your program, just specify the filename as an argument on the command line:
./program.pl file1.txt <optionally more files>
The filenames can then be found inside the script in the global array @ARGV.