![]() |
|
Just another Perl shrine | |
PerlMonks |
Re: unexpected close() success on (non-) filehandleby tachyon (Chancellor) |
on Nov 21, 2001 at 18:33 UTC ( #126767=note: print w/replies, xml ) | Need Help?? |
No this is not incorrect at all, it is exactly what you expect. The glob *X consists of the following elements $X @X %X &X and X (the filehandle). When you write open *X, $foo Perl opens $foo onto the filehandle X from the *X glob. Thus when you say close X you close the filehandle X - this is what your close $_ example does. When you say close *X Perl also does a close X as X is the filehandle in the *X glob - this is what your close $rh{$_} example does. Update (changed code to better example)
Part of the problem you are having is not distinguishing a hard reference (OK under strict) an a symbolic reference (not OK under strict) cheers tachyon s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In Section
Seekers of Perl Wisdom
|
|