package myObj; use strict; sub new { return bless {}, $_[0]; } sub one { print "One\n"; } sub two { print "Two\n"; } sub three { print "Three\n"; } 1; #### #!/usr/bin/perl -w use strict; use lib "."; use myObj; my $s = myObj->new(); my @cmd = qw( one two three ); foreach (@cmd) { $s->$_(); }