in reply to Scalar in Method Call

I suspect it's complaining about your use of a variable within the module identifier (Foo::$type). The code there is ambiguous/bad. You probably want something like this (works in 5.6, not sure about earlier):
my $temp_obj = "Foo::$type"->new(); # or, a more verbose version: no strict 'refs'; # because this isn't very strict my $temp_obj = &{"Foo::${type}::new"}("Foo::$type");

Replies are listed 'Best First'.
Re: Re: Scalar in Method Call
by Dominus (Parson) on Dec 22, 2000 at 21:57 UTC
    Says fastolfe:
    no strict 'refs'; # because this isn't very strict my $temp_obj = "Foo::$type"->new();
    The no strict 'refs' is unnecessary here, since you aren't dealing with references of any sort. The code will run just fine under strict refs.

      You're right; it was the latter method that would have generated the error. I switched the order of the code around and neglected to move the 'no strict' with it.
Re: Re: Scalar in Method Call
by ichimunki (Priest) on Dec 22, 2000 at 09:41 UTC
    Quoting the construct alleviated the error, on to the other bugs. Thanks!