- or download this
use strict;
use warnings;
...
sub bar { my $self =shift; warn "bar: @_\n" }
sub baz { my $self =shift; warn "baz: @_\n" }
- or download this
foo: 0
bar: 1
baz: 2
- or download this
my %meth = ( foo => "foo" );
$o->${\ $meth{foo} }($count++);
- or download this
use constant {
STUFF => {
...
my $key = "BAR";
$o->${ \ STUFF->{$key} }($count++);