in reply to How to execute the perl program on different files in the same directory
for my $input_file (glob '*.txt') { (my $output_file = $input_file) =~ s/txt$/output/; open FILE, '<', $input_file or die "$!: $input_file\n"; # process input close FILE; open FILE, '>', $output_file or die "$!: $output_file\n"; # process output close FILE; }
|
|---|