in reply to $foo = "Foo::Bar"; $foo->new() works?
$ perl -MO=Deparse,-x7 -e'Foo::Bar->new()' 'Foo::Bar'->new; -e syntax OK
Pay attention to the quotes: as far as Perl is concerned, class methods are always invoked on a string containing the package name. Whether that's a literal string or one stored in a variable matters naught.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: $foo = "Foo::Bar"; $foo->new() works?
by gaal (Parson) on Jan 23, 2005 at 16:32 UTC |