#!/usr/bin/perl -w use strict; use lib "."; use myObj; my $s = myObj->new(); my @cmd = qw( one two three ); foreach (@cmd) { $s->$_(); }