It looks like this is a version issue. I tracked down the 5.8.0 documentation, and according to that version of perlopentut, it looks like three-argument open and indirect file handles were not yet implemented. You could try to use IO::Handle, or stick with bare word file handles, e.g.
open (INFILE, 'templateHosts' ) or die "can't open file $!";
or explicitly define your glob with Symbol:
use Symbol;
my $INFILE = gensym;
open ($INFILE, 'templateHosts' ) or die "can't open file $!";
You'll probably have to explicitly close your filehandle assuming you want that done before end of execution. I'd probably go for the last option, as it's the closest to modern syntax. Actually, I'd try and raise enough fuss to upgrade to a modern version of Perl, but I assume that's not an available option....
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
| [reply] [d/l] [select] |
It looks like this is a version issue. I tracked down the 5.8.0 documentation, and according to that version of perlopentut, it looks like three-argument open and indirect file handles were not yet implemented. No, the code posted only requires perl 5.6.0
If OP is getting an error he is not using perl 5.8.0
| [reply] |
| [reply] [d/l] |
The use Symbol; option worked like a charm! Thank you so much. And you are right, the team that supports internal servers doesn't let anyone touch "their" servers and never upgrades. -.- I have said something about it and their answer was use this server instead, xxx, but it had the same perl version on it. Anyway thank you for your time, now I can move on with this script!
| [reply] |