package Example::Foo;
use strict;
use warnings;
use Example::Foo::One;
my $obj = new Example::Foo;
$obj->One();
sub new {
my $self = shift;
return bless {}, $self;
}
sub One {
my $self = shift;
my @caller = caller();
print "Example::Foo::One called, caller is $caller[0], line $caller[2]\n";
print "...Ref self is: ".(ref $self)."\n";
$self->Two();
}
sub Two {
my $self = shift;
my $one = new Example::Foo::One('arg' => 'value'); ## Line of interest
}
1;
####
package Example::Foo::One;
use strict;
use warnings;
sub new {
my $self = shift;
print "Calling Example::Foo::One::new\n";
return bless {}, $self;
}
1;
####
my $one = Example::Foo::One->new('arg' => 'value');