Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

dynamic module loading

by cjcollier (Novice)
on Jul 15, 2003 at 20:32 UTC ( [id://274563]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://274563]
Approved by BMaximus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-19 10:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found