Yes, I also had similar problems when attempting to do such a thing. For additional modules do:

pp -M this::module -M that::module -o out.exe foo.pl

... and I believe in reference to your last question you must include two things:
- a similar folder name of the my_script.pm (module or script) you want to import as it appears in your @INC using -I
- and also add the script using a full path name using -M.

pp -I \another\folder -M some::module -M c:\full\path\my_script.pm -o out.exe foo.pl

Note: I'm never done this way of -I although I believe its the solution and will be attempting on the next PAR I do

Also, I'm not sure if in writing the command in any particular order is important but I'd suggest doing -I before -M just in case.

Additionally, if you don't create the additional folder in the archive using -I it will drop your own my_script.pm that you imported using -M into the root of the PAR archive. Although this isn't probably the cleanest way to pack the archive, I found for my programs (EXE's) it still finds the my_script.pm because it must search this root folder of the archive for included modules/scripts.

Also, the PAR archive is really a zipped archive which can be viewed in Winzip. If you create the PAR file without using the -o flag like this:

pp -I \another\folder -M some::module -M c:\full\path\my_script.pm foo.pl

... and then open the resulting PAR file in winzip you'll get an idea of the structure and setup of the PAR archive. Hope that helps.

Dean
The Funkster of Mirth
Programming these days takes more than a lone avenger with a compiler. - sam
RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers

In reply to Re: PAR Question by crabbdean
in thread PAR Question by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.