ichimunki has asked for the wisdom of the Perl Monks concerning the following question:
The answer to this is probably right in front of my face, but I'm stuck. I know there must be an alternative that doesn't involve a lot of if-thens.use strict; require 'foo_bar.pl'; #currently using require for these require 'foo_batz.pl'; #intention is to fold them into the #script after development my @Stack = (); my $type = "Bar" || "Batz"; do_phu($type); sub do_phu { my $class = shift; my $temp_obj = Foo::$type->new(); push( @Stack, $temp_obj ); # point of failure }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Scalar in Method Call
by Fastolfe (Vicar) on Dec 22, 2000 at 09:29 UTC | |
by Dominus (Parson) on Dec 22, 2000 at 21:57 UTC | |
by Fastolfe (Vicar) on Dec 22, 2000 at 22:13 UTC | |
by ichimunki (Priest) on Dec 22, 2000 at 09:41 UTC | |
|
Re: Scalar in Method Call
by Anonymous Monk on Dec 23, 2000 at 01:56 UTC |