|laziness, impatience, and hubris|
POE & Tk totally confound perlapp (or am I missing something?)by cmv (Chaplain)
|on Apr 17, 2009 at 18:19 UTC||Need Help??|
cmv has asked for the wisdom of the Perl Monks concerning the following question:
Can anyone use perlapp and successfully build a working *.exe for any perl script that uses both POE and Tk?
I can't, and am very confused and frustrated.
Step 1: Get a working Perl/POE/Tk program not written by me (...well mostly)The POE Cookbook is the most logical place to find something. Unfortunately the existing sample program doesn't work on either MacOS or Windows right out of the box (the GUI window never shows up). I had to add some (poe_main_window->update)'s in it to give it basic functionality. I also added a check to error out if poe_main_window is not defined (for reasons that will become apparent later on). This version seems to work fine:
Step 2: Figure out how to use perlapp on itThis wasn't as easy as I thought it should be. At first, I just simply kept on adding modules using the --add module command-line options for perlapp. I ended up with this:
However, anytime it is run it will die claiming that poe_main_window is not defined (remember the error check I added?). Oh, and also note that the *.pl script works fine and the *.exe doesn't on the same machine. Grrrrr.
Step 3: GoogleAs is typical for me, I resort to finding others who've solved the same problems that I'm experiencing. Hmmm, not a lot of useful stuff here. Lots of old links talking about using the POE::Preprocessor which doesn't seem to be around anymore (according to this web page).
In fact, I have already asked about this problem here at perlmonks, without really knowing it is a poe_main_window problem. In that code, you'll notice I did a sneaky thing with the lines:
In Rocco's response he questioned this, but I never followed up (Note-to-self: NEVER use MainWindow->new() when POE is in the mix...).
Step 4: PerlmonksAsk the experts.
So... it it possible to do this, and if so, how?