in reply to Re^2: create an object where type is a variable
in thread create an object where type is a variable

Ahh... my problem was that i was trying to do something like this:
use test::object; my $x='object'; my $y=test::$x->new();

That didnt work, and i just realized it was because you have to concat the 'test::' and $x... just in case anyone is running into the same issue, it would look like this:
use test::object; my $x='object'; my $y=test::.$x->new();

Thank you everyone.

Replies are listed 'Best First'.
Re^4: create an object where type is a variable
by merlyn (Sage) on Sep 11, 2007 at 16:03 UTC
    my $y=test::.$x->new();
    No, that's *definitely* not what you want. More like:
    my $y = "test::$x"->new;
    Oh, and don't use lowercase class names. Uppercase please.