in reply to Re^2: Use 'use' in foreach
in thread Use 'use' in foreach
Another good wedge is UNIVERSAL::require.
That module has a huge caveat though, and I wouldn't recommend it. It adds two methods to the UNIVERSAL class, the base class for all Perl classes. This means that loading this module can affect every single class and object in the program.
For fixed strings like the OP showed, the eval method is fine, and otherwise, there are other modules on CPAN like Class::Load.
|
|---|