in reply to Re^2: print() on closed filehandle
in thread print() on closed filehandle
Why would one package’s LOG affect another’s?Perhaps through typeglob aliasing ᴀᴋᴀ importing? *LOG = *OtherPack::LOG{IO}
Mind you, there are handles that when used without package qualification do get auto-qualified into main:: rather than into the current package as one might otherwise expect. STDIN, STDOUT, and STDERR work that way, although stdin, stdout, and stderr are only in main::. I wouldn’t suggest using ARGV, ARGVOUT, or _, the stat-cache handle, since all are already used by Perl for their own purposes.
But I don’t see why you couldn’t use an ENV filehandle, for example, as a sort of über-global. I don’t believe that one’s spoken for yet. The other one that appears available for such subterfuge is a SIG filehandle.
But I don’t really suggest it: it would probably just get you talked about. 😒
|
|---|