I am using Getopt function to open 2 separate files with different extensions (.txt and .aspx) in my Perl script by passing single command line argument.
Now, there are many such files of both kinds located in separate folders under the same directory. (Many .txt's in folder text. Same number of .aspx's in folder excel. Folders text and excel are under same directory /pkv/kbv/skv/).
I need to open these files one pair at a time and process them. Then repeat same for remaining pairs (any number). Can I do this by passing command line arguments for the "directory" and "files list"?
use Getopt::Long qw(GetOptions);
GetOptions('in=s') or die;
$txt = $opt_in . ".txt";
$aspx = $opt_in . ".tab" . ".aspx";
open (TXT, "< $txt") || die;
...
close(TXT)
open (ASPX, "< $aspx") || die;
...
close(ASPX)