Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My problem is: how do I instantiate an object dynamically
runtime, when I only know the name of its class?
Eg. something like:
my $calvin = SomeFunkyLoader("Calvin::Hobbes"); # invokes Calvin::Hobbes->new
The only thing about the objects, the class name, will be provided run-time only.
How do I do this??
runtime, when I only know the name of its class?
Eg. something like:
my $calvin = SomeFunkyLoader("Calvin::Hobbes"); # invokes Calvin::Hobbes->new
The only thing about the objects, the class name, will be provided run-time only.
How do I do this??
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Runtime loading of arbitrary objects
by davorg (Chancellor) on Aug 21, 2000 at 14:12 UTC | |
RE: Runtime loading of arbitrary objects
by merlyn (Sage) on Aug 21, 2000 at 17:26 UTC | |
Re: Runtime loading of arbitrary objects
by matthew (Acolyte) on Aug 21, 2000 at 17:48 UTC | |
Re: Runtime loading of arbitrary objects
by JanneVee (Friar) on Aug 21, 2000 at 13:41 UTC |
Back to
Seekers of Perl Wisdom