in reply to Re: Scoping question - will file handle be closed?
in thread Scoping question - will file handle be closed?
After the closing braces, there is nothing left in scope. In spite of that the filehandle FH remains open and $_ will be populated with the first file in /usr.use strict; use warnings; if (1) { my $fh = \*FH; open $fh, 'ls /usr |'; } $_ = <FH>; warn $_;
Update: I didn't realise I was arguing against perldoc. LOL, oh well, I can't retract what I know to be true!
One world, one people
|
|---|