On Fri, Apr 24, 2009 at 11:52 AM, Alex Francis <[email protected]> wrote:
> Does anyone have an easy way to find circular dependency loops between 
> modules?
>
> I'm talking about cases like
> ...

Turns out my example was bad and there's no real issue here - the
problem was my misinterpretation of what "perl -c" does. I was using
"perl -c" to compile-check a load of module files which are normally
loaded via "use", but "perl -c" behaves differently to "use".

Summary in case it's useful to anyone: "require" (and therefore "use")
won't load the same module twice and hence won't cause my "subroutine
redefined" warnings. "perl -c" doesn't count as a "require" i.e.
doesn't populate $INC{file}. So if you "perl -c" a module, that at
some point during compilation comes across a "use" that resolves to
the same original file, it will go ahead and re-evaluate the original
file and generate the redefined warnings.

So it looks like "perl -MModule -e 1" is a better commandline compile
check for Perl modules than "perl -c Module.pm".

Via http://www.perlmonks.org/?node_id=389286 and perldoc -f require

Alex
_______________________________________________
BristolBathPM mailing list
[email protected]
http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm

Reply via email to