The documentation says:
If FILEHANDLE is an undefined scalar variable (or array or hash element) the variable is assigned a reference to a new anonymous filehandleSo this means that when you say open my $fh, ..., it is essentially the same as this:
my $fh = \*ANON; open( $fh, "...");
Since the anonymous filehandle is really created before the open, it will still exist even if the open fails...
| We're not surrounded, we're in a target-rich environment! |
|---|
In reply to Re: Filehandles when Open Fails
by jasonk
in thread Filehandles when Open Fails
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |