That's the problem, it doesn't, but maybe the OP thinks that filehandle is global so it can be used directly from another package (hard to tell without some form of telepathy), and this is the error print would give in that case.
| [reply] |
Exactly! That is his point!
| [reply] |
| [reply] |
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. 😒
| [reply] [d/l] [select] |