geektron has asked for the wisdom of the Perl Monks concerning the following question:
the only reason i can see for these: the module being included isn't used in any other place but that sub.eval "use Foo::Bar::Baz;"; die if $@;
this strikes me as a _bad_ idea, but it's more of an instinctual feeling than anything else.
i know that calls to 'eval' can be expensive, but is this a good way to use them?
i've used the block form of eval frequently, but this doesn't really look like an error that needed to be wrapped in an eval. i know that the memory footprint of the module in question would be a bit larger by adding the 'use Foo::Bar::Baz;' at the beginning of the module ( the more traditional way of 'use'ing modules ), but is that, in itself, a valid justification for this kind of runtime 'use' statement. ..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: runtime "use" statements via string eval
by footpad (Abbot) on Apr 04, 2001 at 04:52 UTC | |
by epoptai (Curate) on Apr 04, 2001 at 07:44 UTC | |
by geektron (Curate) on Apr 04, 2001 at 05:08 UTC | |
by tilly (Archbishop) on Apr 04, 2001 at 17:34 UTC | |
|
Re: runtime "use" statements via string eval
by chromatic (Archbishop) on Apr 04, 2001 at 06:48 UTC | |
by tilly (Archbishop) on Apr 04, 2001 at 17:42 UTC |