#!/usr/bin/perl -w use strict; package Foo; sub new { bless { _this => "this\n", _that => "that\n" }, shift } sub _this { print $_[0]->{_this} } sub _that { print $_[0]->{_that} } package main; my $thing = Foo->new; runTests( $thing ); sub runTests { my $object = shift; my $pkg = ref $object; no strict 'refs'; foreach my $symname (keys %{"${pkg}::"}) { my $sub = "${pkg}::$symname"; if ( defined &$sub and '_' eq substr $symname, 0, 1 ) { $sub->( $object ); # explicitly pass $object to mimic method call } } }