in reply to Re: Passing DATA filehandle to a module under strict
in thread Passing DATA filehandle to a module under strict

If the tool gets in your way of whatever you are doing, disable the tool for the time being.

Indeed, but when disabling strict, try to take advantage of the fact that strict is scoped, so you should disable it in the smallest scope possible. And no strict can take various arguments to control which parts of it you're disabling.

use strict; sub _foo { ... } LAX: { $caller = caller; no strict 'refs'; *{"$caller\::foo"} = \&_foo; }

'refs' is pretty much the only part of strict that it's ever a good idea to disable.