in reply to Re^2: Undefined value as a symbol reference
in thread Undefined value as a symbol reference

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.

Replies are listed 'Best First'.
Re^4: Undefined value as a symbol reference
by Anonymous Monk on Jul 21, 2014 at 22:12 UTC

    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

        :) Not my assertion :) perlver - The Perl Minimum Version Analyzer

        $perl -e 'print "$]\n"' 5.008

        $perl -v This is perl, v5.8.0 built for i586-pc-sco3.2v5.0

Re^4: Undefined value as a symbol reference
by link867 (Initiate) on Jul 21, 2014 at 20:54 UTC
    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!