johndoe3344
Programmer
I have a list of files named 'test1.txt', 'test2.txt', 'test3.txt'... etc to 'test35.txt'. I want perl to open test1, perform some operation, then do the same to test2, and so on.
This is my code fragment:
...
...
for ($a = 1; $a <=35; $a++) {
my $input = "test" . "$a" . ".txt";
open (FH_IN, $input) || die "Error: $!\n";
...
perform some function
...
}
But it gives me an error saying "String found where operator expected at..." Could anyone tell me what I did wrong?
This is my code fragment:
...
...
for ($a = 1; $a <=35; $a++) {
my $input = "test" . "$a" . ".txt";
open (FH_IN, $input) || die "Error: $!\n";
...
perform some function
...
}
But it gives me an error saying "String found where operator expected at..." Could anyone tell me what I did wrong?