in reply to dumping lexical filehandles (updated)

> So lexical file handles are implemented as hidden global stash entries, which are destroyed when the lexical var falls out of scope ?

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 ☆☆☆☆ :)