my $obj1 = Class->new; my $obj2 = Class->new; # definition of singleton method for $obj1 goes here ... $obj1->singleton_method and print "It works.\n"; $obj2->singleton_method and print "It doesn't work.\n";