&{ $var }(@args);
Personally, I would reccomend storing dynamically named subs in a hash, instead, though.
my %subs = ( foo => sub { print 42 }, bar => sub { print "abc" } ); $subs{foo}->(@args);
In reply to Re: Calling a subroutine from a scalar
by friedo
in thread Calling a subroutine from a scalar
by metalgear119
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |