bramble has asked for the wisdom of the Perl Monks concerning the following question:
I'm looking at PBP, the I/O chapter, regarding printing to indirect filehandles.
What exactly does the {$fh} in
evaluate to? Because the docs for print say that it can take a filehandle there, but AFAICT, {$fh} is a wee little block (and not a filehandle), right?open my $fh, '>', 'foo.txt' or die "Ouch. $!"; print {$fh} "hi!\n"; close $fh;
|
|---|