package tests;
sub new{
bless {},shift;
}
sub myfunction_one{
print "This is myfunction_one\n";
sub myfunction_two{
#I never remember this sub existed
print "This is myfunction_two Inside\n";
}
&myfunction_two();
}
sub myfunction_two{
# This is my sub, but I renamed it to fix the issue
print "This is myfunction_two Outside\n";
}
####
#!/usr/bin/perl
use tests;
my $obj = new tests();
$obj->myfunction_one();
$obj->myfunction_two();
####
This is myfunction_one
This is myfunction_two Outside
This is myfunction_two Outside
####
This is myfunction_one
This is myfunction_two Inside
This is myfunction_two Outside