#561 Subroutine X redinfed with circular use

v0.6.x
closed-invalid
nobody
Core (65)
5
2009-08-26
2009-08-19
Patrick Matthäi
No

Hello,

I have got a tons of warnings, that subroutine X is redifned, which is not realy the case, also perl itself does not complain about it, here is an example to reproduce it:

file: test.pl
#!/usr/bin/perl

use warnings;
use strict;
use testmodul1;
use testmodul2;

testmodul1::hello();
testmodul2::world();

file: testmodul1.pm:
package testmodul1;

use warnings;
use strict;
use testmodul2;

sub hello {
print 'Hello ';
}

1;

file: testmodul2.pm:
package testmodul2;

use warnings;
use strict;
use testmodul1;

sub world {
print 'World!', "\n";
}

1;

With this I get:
Description Resource Path Location Type
Subroutine world redefined testmodul2.pm /test line 7 Perl Problem

It appears if modul A uses B and B also uses A, which is a real world case.

Discussion

  • Jan Ploski
    Jan Ploski
    2009-08-26

    The same will happen if you run "perl -c testmodul1.pm" from the command line. Not an EPIC problem.

     
  • Jan Ploski
    Jan Ploski
    2009-08-26

    • status: open --> open-invalid
     
  • Jan Ploski
    Jan Ploski
    2009-08-26

    • status: open-invalid --> closed-invalid
     
  • Ah okay thanks, didn't used -c in any time.

    But it would be nice if I could epic to not start perl with -c.