> perl indobj.pl Bar Undefined subroutine &Bar::Foo called at indobj.pl line 10. #### package Bar; sub new { print "Bar\n"; bless {} } sub addFoo { my $self = shift; $self->{Foo} = new Foo(); # which new gets invoked? } package Foo; sub new { print "Foo\n"; bless {} } package main; my $bar = new Bar(); $bar->addFoo(); # if there's a bug, this should tickle it