cjcollier has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to use a module named $module. I know that if I use strict that I can't do this. How would I get around this? And after I do so, how would I do something like
$object = new $module(%args);

Replies are listed 'Best First'.
Re: dynamic module loading
by valdez (Monsignor) on Jul 15, 2003 at 21:26 UTC
Re: dynamic module loading (today)
by tye (Sage) on Jul 15, 2003 at 21:21 UTC

    See using a variable to specify which perl module to use, which you scrolled past in order to get to the input box to post your question. (:

    Though it doesn't cover some complications that can be had in some situations (but probably not yours) and you probably can just skip the import parts since you are using an OO module (and we could probably skip those in the other thread too).

                    - tye
Re: dynamic module loading
by dragonchild (Archbishop) on Jul 15, 2003 at 20:42 UTC
    Look at perlreftut and perlootut.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      Thanks, I will. I think it's perltoot, though.