in reply to Circular dependencies when using the perl syntax checker

I tried to reproduce your error:
$ echo 'package A; sub foo { }; 1' > A.pm $ echo 'package B; use A; 1;' > B.pm $ perl -w -I. -MA -wle 'use B' # no warnings here

I use A twice, once via the command line, and once indirectly by using B. The -w switch actives warnings globally, and still no warnings about redefinitions.

Maybe you could show us some code that demonstrates your problem?

Replies are listed 'Best First'.
Re^2: Circular dependencies when using the perl syntax checker
by tomdee (Initiate) on Jul 28, 2008 at 14:51 UTC
    I was thinking of something more like:

    echo 'package modA; use modB; sub foo { }; 1' > modA.pm
    echo 'package modB; use modA; 1;' > modB.pm
    perl -c -w modA.pm
    Subroutine foo redefined at modA.pm line 1.
    modA.pm syntax OK

Re^2: Circular dependencies when using the perl syntax checker
by Anonymous Monk on Jul 28, 2008 at 14:45 UTC
    die $INC{'B.pm'};
    C:\>echo package B;sub VERSION{333};1; >B.pm C:\>more B.pm package B;sub VERSION{333};1; C:\>perl -MB -le"print for %INC;die B->VERSION" XSLoader.pm C:/Perl/lib/XSLoader.pm C:/Perl/site/lib/sitecustomize.pl C:/Perl/site/lib/sitecustomize.pl Exporter.pm C:/Perl/lib/Exporter.pm strict.pm C:/Perl/lib/strict.pm B.pm C:/Perl/lib/B.pm 1.09 at -e line 1.