I have a problem with circular library "require" statements:
Subroutine A, which resides in libA.pl, calls a subroutine in libB.pl. So libA.pl needs a "require libB.pl" statement. Subroutine B, which resides in libB.pl, calls a subroutine in libA.pl. So libB.pl needs a "require libA.pl" statement.
The problem is that libA.pl includes libB.pl, and that includes libA.pl. So, the various subroutines in libA.pl have already been included (via "require libB.pl") by the time I actually defined them in libA.pl, and that produces a warning message: Subroutine A redefined at line xxxx.
I can avoid this by putting all the subroutines in the same file, but that is undesirable. I'm sure this issue has been addressed before, but I couldn't find it in the archive. How do perl programmers resolve this type of issue?
Jim
In reply to Redefined subroutines in multiple libraries by James Board
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |