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

I wrote the following script....fairly simple. I went ahead and created an exe using PAR with the following command: pp --icon "path/to/pic.ico" --gui -o file.exe file.pl The program works great on my home computer. I transfered it to my computer at work this morning and exe program isn't doing anything. I was wondering if it might be somehting with PAR command? This is my first file trying to change the icon, but I don't think that is it. When I double-click on the icon the hourglass will run for about 5 seconds then nothing.....what am I doing wrong. Both my computers at home and at work have the latest perl.....so it should be working!
#!/usr/bin/perl use Encode::Unicode; use Tk; $mw = new MainWindow(-title=>"Keyword Tidy"); $mw->withdraw(); $frame1 = $mw->Frame()->pack(-side=>top); $text = $frame1->Scrolled("Text", -scrollbars=>'e', -width=>45, height +=>20, -font=>"Arial 10 normal")->pack(-side=>top, -padx=>7, -pady=>7) +; $frame2 = $mw->Frame()->pack(-side=>top); $label = $frame2->Label(-text=>"Remove:", -font=>"Arial 10 bold")->pac +k(-side=>left, -padx=>7, -pady=>7); $entry = $frame2->Entry(-width=>20)->pack(-side=>left, -padx=>2, -pady +=>7); $button = $frame2->Button(-text=>"Tidy Up", -command=>\&doit)->pack(-s +ide=>right, -padx=>10, -pady=>7, -ipadx=>10, -ipady=>7); $mw->deiconify(); MainLoop(); sub doit { $words = $text->get("1.0", "end"); $text->delete("1.0", "end"); $toremove = $entry->get(); @w = split(/\n/, $words); foreach $i (@w) { $i =~ s/\s+$//; $i =~ s/^\s+//; $i =~ s/$toremove//g; } $done = join("\n", @w); $text->insert("end", $done); }

Replies are listed 'Best First'.
Re: Perl/Tk exe not working
by rinceWind (Monsignor) on Oct 10, 2005 at 15:48 UTC

    As gri6507 has suggested, you need to try running it from a command window. To do this, do another build without the --gui option. I take it that running your PAR built .exe works on your home machine.

    Also, it might be worth while putting a debug mode, and log statements so that you can get a better idea of what it's doing. Something like Log::Log4perl might be useful here. If you save the output, this might be a useful diagnostic tool for support.

    Could you also identify which version of PAR you are running.

    --

    Oh Lord, won’t you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, won’t you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)

      I ran the program without the --gui option and got some good info. The problem seems to be with Encode::Unicode module. Here's what it says: Encode object version 1.99_01 does not match bootstarp parameter 2.09 at......then it lists a whole bunch of places that it failed within the Encode::Unicode module. Is the problem with the version of the Encode::Unicode module? Not really sure what this means.

        This sounds like a UTF-8 problem. There have been big changes to the perl core in this area since 5.6.1.

        Please could you run the following commands on your home machine, and paste the output:

        perl -v perl -V perl -MPAR -e "print PAR->VERSION,qq(\n)" perl -MEncode::Unicode -e "print Encode::Unicode->VERSION,qq(\n)"

        --

        Oh Lord, won’t you burn me a Knoppix CD ?
        My friends all rate Windows, I must disagree.
        Your powers of persuasion will set them all free,
        So oh Lord, won’t you burn me a Knoppix CD ?
        (Missquoting Janis Joplin)

Re: Perl/Tk exe not working
by gri6507 (Deacon) on Oct 10, 2005 at 15:37 UTC
    Have you tried running the executable from a command window? There may be some information printed out that could help you/us to determine the problem.
      Yes, I've tried that and nothing is printed out.