in reply to Re: Passing a Filehandle that Might be a Bareword
in thread Passing a Filehandle that Might be a Bareword

At the risk of beating a rotten equine carcass, our $fh doesn't really work nicely no matter what its scope. If the user's code contains two calling modules, each of which use My::Module $fh, there will be a conflict. I'm sure that's obvious. The standard way of dealing with this is like:

use My::Module; our $tank = My::Module->new($fh);

... but since My::Module is actually a fire-and-forget source filter, caller never explicitly does anything with $tank, which should be a package variable anyway. I'm not willing to demand that caller declare $::tank himself according to some prescribed cargo cult code; therefore, I stash-and-grab.

I promise that all this will make more sense when I get the thing out the door.

- the lyf so short, the craft so long to lerne -