Base.pm: package Base; sub method1 { # Insert code here }; Foo.pm: package Foo; use Base; @ISA = qw(Base); Bar.pm: package Bar; use Base; @ISA = qw(Base); Main.pm ... foreach my $classname qw(Foo Bar) { $classname->method1; }