tags:

views:

67

answers:

2

This is probably a newbie question as I have just started using pp. I read the documentation on CPAN and tried to create an executable for my application. I use Camelbox and Tk on Windows XP, PAR::Packager version 0.991 (PAR version 0.994). To make sure pp works I created a very simple hello_world.pl using Tk, compiled it into an .exe and ran it. So far so good.

When I use pp -o out.exe my_program.pl on my application and try to run out.exe, a console window appears and shortly after dies without error message. The problem is that I don't know where to start looking for a solution since there is no message. I tried to do the same using tkpp (a gui for pp) since it writes a log file - but the effect is the same and the log file is empty. Can someone please help me?

+1  A: 

If you don't get an error how do you know it dies?

It's possible your program works just fine but the console window is closing before you can see the output.

Perhaps try pausing after printing hello world?

print "Hello, World!";
<>;  # pause for input
Ed Guiness
Thank you for your suggestion. Using a tiny hello world program it does wait for the input, starts and stopps without errors. My application however has a Tk gui wich opens a dialog box. When packed with pp it doesn't do anything. At least I know now that there is an error message displayed - the console closes just too quick to read it. How can I prevent the console from closing?
Nele Kosog
@Nele Kosog: Run the program from a command prompt (instead of double-clicking on it from Explorer).
Michael Carman
Thank you, Michael - sometimes it's so obvious, I just miss it.
Nele Kosog
+2  A: 
  1. Upgrade Module::ScanDeps to latest version (or 0.95) and retry

  2. Run you program from command prompt console window, copy error message and send it to PAR mailing list or PAR::Packer bug tracker

Alexandr Ciornii
Thank you for your reply. CPAN tells me Module::ScanDeps is up to date. But your second hint finally gives me the error message I have been looking for. One of my own modules has not been included into the executable. Do I have to specify each module separately? I "use" them and they are in the same directory as the program I am trying to pack.
Nele Kosog
You module should be picked automatically if you use "use" or "require" without variable. If you use something like "eval "use $var"", you need to add module with '-M'. In general, it is hard to tell without seeing sources.
Alexandr Ciornii
Alexandr, I get an idea of what the problem might be. I use CPANs FindBin to detect the local directory and "use lib" the path it's creating. It's just like using "use $var" - thank you!
Nele Kosog