http://qs1969.pair.com?node_id=1187281


in reply to Re^2: Track open file handles
in thread Track open file handles

Yes, true. It's actually more complicated than that. A lexical filehandle is made into a GLOB reference by open. But since that open() happens in FileHandle::Track, the associated symbol is generated using that package and the lexical filehandle variable

Ah, but that is yet another different problem affecting only the name of the glob, which is something quite unimportant.

I was talking about file handles passed as arguments by name. open looks for then into the caller package, so you would probably have to add specific code to handle those cases and qualify the file handle names yourself, or use some other trick, like creating the wrapper in the DB namespace, or using XS, etc.

update:

I can see no way to circumvent that

Probably some module exists on CPAN allowing you to change the glob name.