Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: How to a construct objects with variables as class names?

by joecamel (Hermit)
on Feb 14, 2001 at 11:32 UTC ( [id://58306]=note: print w/replies, xml ) Need Help??


in reply to Re: How to a construct objects with variables as class names?
in thread How to a construct objects with variables as class names?

Thanks Adam,

I changed the method to the following, which worked perfectly:

my $fullClass = "SuperWidget::Widget::" . $className; my $widget = $fullClass->new($widgetID);
I normally use the -> operator for method calls, but figured the only way to dynamically name an object was with the new class (@args) format.

joecamel

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found