you're still useing the modules at the beginning, even though they're wrapped in an eval. and they're wrapped in an eval for a reason -- you're handing the scripts off to folks who may or may not have that resource.
the issue, with more context:
in some cases, the same eval "use Foo::Bar::Baz;"; will end up in a different sub, same module. . .sub do_stuff { ### some stuff eval "use Foo::Bar::Baz;"; die if $@; ## do stuff with the imported functions }
there's no 'hand off to client' - these are all internally-developed modules. . .
i know that it's perfectly legal perl syntax . . . . it just doesn't sit quite right with me . .
UPDATE: the thing is, and i haven't made it clear, is that the module being used in the eval string is NOT being used on 'initialization' ( for lack of a better word ). there's no 'use Foo:Bar::Baz;' at the beginning for the module. . .
and i've been looking to see if there were any other issues than 'bad style'.
In reply to Re: Re: runtime "use" statements via string eval
by geektron
in thread runtime "use" statements via string eval
by geektron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |