In perldoc forprint , he says this should work:
print { $OK ? STDOUT : STDERR } "stuff\n";
But this is not with use strict, and when I then use quotation marks like
print { $OK ? "STDOUT" : "STDERR" } "stuff\n";
I get
Can't use string ("STDOUT") as a symbol ref while "strict refs" in use ...
How can I make this structure work without performing use strict?
Thank,
Mazze
Mazze source
share