in reply to Using objects where you don't know the module's name until run time.
only ensures that an exception will be thrown if $class_name hasn't been loaded. Presumably you think all the modules you may ever need will have already been loaded at compile time. If you want require to go out and load the class from a file at runtime, sayrequire $class_name;
This allows you to leave unwanted modules unloaded, with possible performance gains.eval "require $class_name";
Originally posted as a Categorized Answer.
|
|---|