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

I've written a progtam to update Excel. The program takes the input from a input file and prints it in the excel sheet. Since the target machine does not have the required modules,I used perl2exe to convert it to an exe. The Perl script when I execute as (program.pl) it works fine without any issues but the EXE fails to execute. It didn't give any output. Since, the EXE is not throwing any error/warning, I couldn't guess the issue. Please help me resolve this.
  • Comment on Perl script <name.pl> works but EXE <name.EXE> fails

Replies are listed 'Best First'.
Re: Perl script <name.pl> works but EXE <name.EXE> fails
by Corion (Patriarch) on Jan 13, 2009 at 09:13 UTC

    It may also be a permissions issue. I think perl2exe tries to extract the files to C:\Temp (or wherever $ENV{TEMP} points) and then launches the program from there. So a possible approach would be to try the program on a machine without restrictive permissions or to sprinkle the source code with BEGIN { warn "I am at line " . __LINE__ } to see where it stops.

Re: Perl script <name.pl> works but EXE <name.EXE> fails
by athanasia (Pilgrim) on Jan 13, 2009 at 09:05 UTC
    Hi,

    Since you haven't provided your actual code, it is a bit tricky to guess what is going on. Based on my own experience, I once faced this problem (filename.pl running correctly but filename.exe not being executed) because the path I had defined for images and scripts being used in my script was not correct for the exe.

    Cheers,
    Athanasia
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl script <name.pl> works but EXE <name.EXE> fails
by Anonymous Monk on Jan 13, 2009 at 09:03 UTC
    Add print statements until you find where the program gets stuck, or use Devel::Trace for shortcut (works under perl -d).