go ahead... be a heretic | |
PerlMonks |
Re^3: File handles and loopsby tobyink (Canon) |
on Aug 01, 2012 at 06:29 UTC ( [id://984704]=note: print w/replies, xml ) | Need Help?? |
You rarely need to close lexical file handles. They automatically close once the variable goes out of scope. That is, if the my $fh is defined within a function, then once that function finishes executing, the file handle disappears.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|