in reply to dumping lexical filehandles (updated)
fascinating, seems like scoping behavior is implemented by localizing the hidden stash entry :)
#!perl use Data::Dumper qw/Dumper/; open my $fh,"<",'/tmp/tst'; my $outer=$fh; print 0+($outer == $fh),": ", Dumper $fh; { open my $fh,"<",'/tmp/tst'; print 0+($outer == $fh),": ", Dumper $fh; }
out
1: $VAR1 = \*{'::$fh'}; 0: $VAR1 = \*{'::$fh'};
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
|
|---|