in reply to Re: Howto include Module with Specific Methods with PAR's pp utility
in thread Howto include Module with Specific Methods with PAR's pp utility

McDarren, Thanks for the pointer.

But if it is automatically done, then on what circumstances
-M option should/can be used, as described in pp doc?

Regards,
Edward
  • Comment on Re^2: Howto include Module with Specific Methods with PAR's pp utility

Replies are listed 'Best First'.
Re^3: Howto include Module with Specific Methods with PAR's pp utility
by syphilis (Archbishop) on Oct 28, 2006 at 08:35 UTC
    what circumstances -M option should/can be used

    Sometimes pp fails to pull in a module if the script does not explicitly use that module. Not sure of the details, but it can happen - and if that does happen, then you can use the -M option to load the module. So ... I guess you're wondering what to do when when the module that pp fails to pull in needs to also export some functions.

    I don't think pp's -M switch can handle that - though I could be wrong. I certainly didn't manage to find an incantation that works.

    You can, however, work around the problem by rewriting the perl script so that it explicitly loads the module and exports the desired functions. That way there will be no need to load the module using the -M switch.

    Cheers,
    Rob
      I don't think pp's -M switch can handle that - though I could be wrong. I certainly didn't manage to find an incantation that works.

      perl is not pp, and -M doesn't serve the same purpose.