#384 Open Declaration opens wrong module

v0.5.x
open
nobody
Editor (234)
5
2007-04-12
2007-04-12
Anonymous
No

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

Discussion