What about this?
open(my $fh, 'somefile') || die $!;
When calling open with an undefined variable for the indirect filehandle ($fh in this case), open will stick a reference to the "real" filehandle in the indirect filehandle. $fh is a lexical, what it refers to is not.
— Arien
In reply to Re: local vs my
by Arien
in thread local vs my
by rzward
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |