in reply to Re: Re: problems returning from recursive subroutine
in thread problems returning from recursive subroutine

You are wrong about your second point. The handle is being closed explicitly as far as that part of the documentation is concerned. It goes out of scope and gets closed by perl; the filehandle visible during the next execution of the block is a different one from that of the previous. It's not the same filehandle being closed implicitly due to a subsequent open.
$ (echo 1 ; echo 2 ; echo 3) > 1 $ (echo 1 ; echo 2 ; echo 3 ; echo 4) > 2 $ perl -le'for(@ARGV) { open my $fh, "<", $_; 1 while <$fh>; print $. +}' 1 2 3 4 $ perl -le'for(@ARGV) { open my $fh, "<", $_; 1 while <$fh>; print $. +}' 2 1 4 3
Q.E.D.

Makeshifts last the longest.

  • Comment on Re^4: problems returning from recursive subroutine ("implicit" ne "implicit")
  • Download Code