in reply to Scalar in Method Call

Here is the way I was shown, just put the module names into a hash reference:
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 $mods = { 'Bar' => 'Foo::Bar', 'Batz' => 'Foo::Batz', }; my @Stack = (); my $type = "Bar" || "Batz"; do_phu($type); sub do_phu { my $class = shift; my $temp_obj = $mods->{$type}->new(); push( @Stack, $temp_obj ); # point of failure }