Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm using PAR, I'm trying to compile two module into one file but how to do that;-

pp -o out.exe -M PSP::Httpd PSP::Docs

the result would be "Can't find PSP::Docs", if I write PSP::Httpd first thatn it can't find PSP::Httpd.

Another Question, How do I pack script from different folder. Like this?

pp -o out.exe perl.pl pdp/perl.cgi pdp/perl2.cgi ??

Thanks....

Replies are listed 'Best First'.
Re: PAR Question
by gaal (Parson) on Jul 17, 2004 at 16:54 UTC
    Try pp -o out.exe -M PSP::Httpd -M PSP::Docs (another -M)
Re: PAR Question
by crabbdean (Pilgrim) on Jul 18, 2004 at 11:37 UTC
    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