in reply to How best to require subclasses at runtime

I'm using  eval "use $m"; to solve a similar problem.
I'm interested in learning other options too.

About the startup wait, Perl 5.8 has an "autouse" option, that postpone load of modules until a function is used.

Replies are listed 'Best First'.
Re: Re: How best to require subclasses at runtime
by Revelation (Deacon) on Nov 07, 2002 at 21:59 UTC
    And CPAN has Class::Autouse

    OR
    # I use $module, because $m is not descriptive enough for me. $package_file = $module . '.pm'; $package_file =~ s~::~/~g; # Should probably use a module to get the seperator, but whatever. require($package_file) or die ( $@ ); $self->{'parser '} = $module->new();


    Gyan Kapur
    gyan.kapur@rhhllp.com