johndoe3344
Programmer
The segment of code in question is:
Let's say input.txt consists of the lines:
file_name_1.txt
file_name_2.txt
file_name_3.txt
What I want the script to do is open each of these files, and invoke a certain subroutine with each one. Would that work?
open (INPUT, "input.txt") or die "Could not open input file.\n";
for my $var (<INPUT>) {
open (VAR, $var) or die "Failed. \n";
subroutine();
}
Let's say input.txt consists of the lines:
file_name_1.txt
file_name_2.txt
file_name_3.txt
What I want the script to do is open each of these files, and invoke a certain subroutine with each one. Would that work?