#!/usr/bin/perl -wl use strict; no strict 'refs'; { package Foo; sub foo { 1 } } { package Bar; use base 'Foo'; } my $object = 'Bar'; # just the class name my $method = 'Bar::foo'; print "$object->$method ", eval { $object->$method } ? 'ok' : 'not ok'; print "&$method($object) ", eval { &$method($object) } ? 'ok' : 'not ok'; __END__ Bar->Bar::foo ok &Bar::foo(Bar) not ok