in reply to Re: repeated use of module and EXPORT
in thread repeated use of module and EXPORT

That is a common statement to not have each use the other... but there is nothing wrong with doing so... and in this case it makes good sense... In the real case, libs and dbg... I would have to copy various libs subs into the dbg module to avoid the loop. which would cause duplication of code, which is also a never do... And since the two modules come together it is okay for them to rely on each other.
in a certain sense, dbg is like a class that is being inherited, and libs is just a general module of subs to be used by anyone. So for them to be interdependent isn't really a problem for the design...
  • Comment on Re^2: repeated use of module and EXPORT

Replies are listed 'Best First'.
Re^3: repeated use of module and EXPORT
by MidLifeXis (Monsignor) on May 23, 2008 at 16:25 UTC

    How about having a third package, let's call it util, that contains the shared code. Include util in both libs and dbg, and you no longer have the loop.

    --MidLifeXis

      ... and you no longer have the loop.

      There is no loop. Each piece of code gets compiled once. As one piece of code uses the other one, it gets what is defined at that moment of compilation, that's all - perl won't loop switching compilation from one to the other and from the other to the one and back and forth again over and over.

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

        I wasn't implying that there was a execution loop. More a logical design loop. Sorry for the poor conveyance of meaning :)

        --MidLifeXis

      My reply to this doesn't seem to be showing up, but I will try one last time... That doesn't work out. In the real case the Z module is a dbg module, and all modules use dbg... so the new module would also use dbg, and the loop would still be present.
Re^3: repeated use of module and EXPORT
by Anonymous Monk on May 23, 2008 at 16:32 UTC
    Yes there is - you don't know how to make it work. Listen to MidLifeXis suggeststion, and put the common functions in a another module.
      Actually, no that still doesn't work. The Z module is a dbg module. Every function no matter where it is in any module will still have some dbg code in it. So you would still have the loop of dbg calling the new module and the new module calling dbg.