sub foo { print 'bar' } $var = 'foo'; main->$var; #### %subs = ( 'foo' => \&foo, 'bar' => \&bar, # etc ); print $subs{$var}->($arg1, $arg2);