Also, are you certain that you've replicated the code exactly? From open:open( my $INFILE, '<', 'templateHosts') or die "can't open file $!";
If FILEHANDLE is an undefined scalar variable (or array or hash element), a new filehandle is autovivified, meaning that the variable is assigned a reference to a newly allocated anonymous filehandle. Otherwise if FILEHANDLE is an expression, its value is the real filehandle. (This is considered a symbolic reference, so use strict "refs" should not be in effect.)It looks like the interpreter is regressing into this symbolic reference behavior, though this would presuppose your value is not null.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re: Undefined value as a symbol reference
by kennethk
in thread Undefined value as a symbol reference
by link867
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |