in reply to Why does this code think I'm trying to use symbolic references?
print $n ... expects $n to contain a file handle. 1000 is not a file handle and "strict refs" forbids using the string to reference a variable. Consider:
#! perl my $n = 'STDOUT'; print $n "Now we's happy\n"; use strict; print $n "Now we's not\n";
Prints:
Now we's happy Can't use string ("STDOUT") as a symbol ref while "strict refs" in use + at ...\noname.pl line 8.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why does this code think I'm trying to use symbolic references?
by BrowserUk (Patriarch) on Jun 12, 2016 at 22:25 UTC | |
by AnomalousMonk (Archbishop) on Jun 12, 2016 at 22:58 UTC |