Help for this page
my %dispatch = ( Foo => \&_foo, Bar => \&_bar, ... my $method = $dispatch{$type} || die "Can't find method ..."; $self->$method($data); }
multimethod process (Foo $thing, String $data) { ... } multimethod process (Bar $thing, String $data) { ... } multimethod process (Baz $thing, String $data) { ... }
sub name { my ($self, $name) = @_; $self->{name} = $name if $name; return $self->{name}; }
www.com | www.net | www.org
No recent polls found