Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
But this doe not, it gives a syntax error:#!/usr/bin/perl use strict; use warnings; my $f=\*stdout; my $h={}; $h->{FILE}=$f; print $f "Hello\n";
The only change is that I use an expression involving hashref for the file handle in the second case rather than a variable. Is this not allowed?#!/usr/bin/perl use strict; use warnings; my $f=\*stdout; my $h={}; $h->{FILE}=$f; print $h->{FILE} "Hello\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unexpected results with expression for file handle in print
by tobyink (Canon) on Feb 13, 2014 at 10:24 UTC |