in reply to how can I input different files as an argument while I am running my perl program?
Example:
program.pl file1 file2 file3
The array @ARGV contains the command line arguments intended for the program. To get the filename or filenames you simply get it from your @ARGV array as follows:
ormy $file = shift(@ARGV); # for one file
You can then do whatever you need to with the file names.my @files = @ARGV; # for more than one file
|
|---|