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

Monkfan,

As discussed privately, you don't need to include all those module calls on the command line. Whatever is included (use'd) in your script will be included in the executable.

All you really need is something like:

pp -o mycode.exe mycode.pl

Cheers,
Darren :)

  • Comment on Re: Howto include Module with Specific Methods with PAR's pp utility
  • Download Code

Replies are listed 'Best First'.
Re^2: Howto include Module with Specific Methods with PAR's pp utility
by monkfan (Curate) on Oct 28, 2006 at 07:10 UTC
    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
      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.