If you have two modules having subroutins with the same name perl uses the one taken from the lates of use list.
But Open Declaration feature opens the first from the use list.
Here is an example:
--------------------------------------
TestStart.pl:
#!/usr/bin/perl
use strict;
use warnings;
use Modules::ModuleTest;
use Modules::ModuleOverwrite;
nothing(); ## Use Open Declaration here
exit 0;
--------------------------------------
Modules/ModuleTest.pm:
package Modules::ModuleTest;
use strict;
use warnings;
require Exporter;
use vars qw (@ISA @EXPORT);
@ISA=("Exporter");
@EXPORT = qw (nothing);
sub nothing(){
print("Test");
}
1;
__END__
--------------------------------------
Modules/ModuleOverwrite.pm:
package Modules::ModuleOverwrite;
use strict;
use warnings;
require Exporter;
use vars qw (@ISA @EXPORT);
@ISA=("Exporter");
@EXPORT = qw (nothing);
sub nothing(){
print "Conflict";
}
1;
__END__
--------------------------------------
Open declaration will jump to ModuleTest::nothing but perl execute ModuleOverwrite::nothing.
Contact: tamas.tarjanyi@gmail.com
Best Regards: Tamás Tarjányi
Considered bad practice, as only during run-time one would find out which method is called. Closing as won't fix.