in reply to Re: Subroutine redefined
in thread Subroutine redefined

Perl won't run a module twice, but when running a .pm as a script, it doesn't count as module. In other words, your module is fine. It's how you run it that's broken.

Replace
perl -c TestVar.pm
with
perl -ce "use TestPm"
to fix the problem.

However, I think there's a design problem when two modules include each other.

Replies are listed 'Best First'.
Re^3: Subroutine redefined
by Anonymous Monk on Aug 16, 2006 at 03:51 UTC
    DOH!

    You know, I never actually ran it. I just do the perl -c compulisivly before I even run it. Sure enough:
    #!/usr/bin/perl use strict; use warnings; use TestPm; TestPm::foo();
    Works fine, no errors. Thanks a mil.