On Sun, Feb 25, 2007 at 12:27:49PM +0200, Yossi Itzkovich wrote:
> I would like to write a method that gets class name as a parameter and
> creates an object of this class with a parameter.
>
> For example, for class MyClass I should have something like:
>
> sub factory
> {
> my ($className,$param)[EMAIL PROTECTED];
>
> my $returnValue= new {$className}($param);
> }
>
> This syntax doesn't work, and I can't find something that works. Can
> someone help me?
$className->new($param);
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl