in reply to Re: anonymous filehandle for overridden open sub
in thread anonymous filehandle for overridden open sub
Surprisingly, no one managed to hit the reason why this fails.
Sorry for tooting my own horn here, but some of us did :-) .
In your original code, $filehandle is referencing a global glob. With your new code, $filehandle is now ... undef.
Therefore, give the overriding open a non-undef lexical handle instead: open(my $AFILE = IO::File->new(), ... ). This solution has the virtue that it does not require that the overriding open be modified, something that may not be possible or desirable.
the lowliest monk
|
|---|