#!/usr/bin/perl use strict; use warnings; BEGIN { print "can=", __PACKAGE__->can('fred'), ";\n"; } sub fred { print "fred\n"; } print "can=", __PACKAGE__->can('fred'), ";\n"; fred; undef &fred; print "can=", __PACKAGE__->can('fred'), ";\n"; fred; #### Use of uninitialized value in print at test.pl line 5. can=; can=CODE(0x81199b4); fred can=CODE(0x81199b4); Undefined subroutine &main::fred called at test.pl line 11.