sub foo; # stub print("\&foo is ", defined &foo ? 'defined' : 'not defined', "\n"); print(__PACKAGE__->can('foo') ? 'Can' : 'Can\'t', " foo\n"); foo(); __END__ &foo is not defined Can foo Undefined subroutine &main::foo called.