Yes, I gave PlxHml.pm the package name PlxHml, and removed the "use Plx;" statement. x_log is indeed defined in Plx.
I thought I had been told that exporting into main made the resource available to all modules, but I guess I misinterpreted what I heard. So I just added the use statements back into each module. Plx now uses PlxHml and PlxLang, PlxHml now uses Plx and PlxLang, and PlxLang now uses Plx and PlxHml. All scripts include all 3 "use" statements.
Now I'm getting
c:\()hml.pl
Undefined subroutine &PlxHml::x_log called at C:/Perl64/site/lib/PlxHm
+l.pm line 50.
Compilation failed in require at C:/Perl64/site/lib/Plx.pm line 128.
BEGIN failed--compilation aborted at C:/Perl64/site/lib/Plx.pm line 12
+8.
Compilation failed in require at C:\!dh\DH\COM\SRC\hml.pl line 206.
BEGIN failed--compilation aborted at C:\!dh\DH\COM\SRC\hml.pl line 206
+.
Line 50 of PlxHml.pm is
x_log("\n($PM_PLXHML)");
Line 128 of Plx.pm is
use PlxHml;
And line 206 of hml.pl is
use Plx;
| [reply] [d/l] [select] |
You should not have modules using each other in a circular fashion.
Have either Plx use PlxHml or have PlxHml use Plx, but not both.
| [reply] [d/l] [select] |
Thanks, Corion, but I'm not sure I understand. Plx needs functions defined in PlxHml, and PlxHml needs functions defined in Plx. How do I implement this?
| [reply] |