use v5.6.1; #ActiveState build 626 use strict; use warnings; package Foo; sub bar { print "Foo::bar has been called\n"; } sub new { my $s= 0; return bless \$s, "Foo"; } package main; *newFoo= \&Foo::new; my $x1= new Foo::; $x1->bar(); # OK print "before:", join (' ', keys %main::), "\n"; delete $main::{"Foo::"}; print "after:", join (' ', keys %main::), "\n"; $x1->bar(); # still works! my $x2= newFoo(); # works $x2->bar(); # can't find "Foo"