use strict; use warnings; use 5.012; package Person; sub new { my $class = shift; my $self = {}; bless $self, $class; return $self; } sub do_this { my($self, $greetee) = @_; say "hello $greetee"; } sub do_that { my($self, $greetee) = @_; say "goodbye $greetee"; } 1; #### use strict; use warnings; use 5.012; use Person; my $obj = Person->new; $obj->do_this("Sam"); $obj->do_that("Cathy"); say '*' x 20; my @func_names = ('do_this', 'do_that'); my @names = ("Sam", "Cathy"); call_funcs(@names); sub call_funcs { for (@func_names) { $obj->$_(shift @_); } } --output:-- hello Sam goodbye Cathy ******************** hello Sam goodbye Cathy