in reply to Re^8: making perl executable
in thread making perl executable

Here's an example running on windows:

#!/usr/bin/perl use strict; use warnings; use Text::CSV; print "Derp\n";

Ensure the code runs as expected from the command line. Now package it and the modules used:

D:\>pp -x -o derp.exe derp.pl Derp

Note that -x runs the code, which is why Derp is displayed, this determines other runtime based dependencies. Now I see:

D:\>dir derp.exe Volume in drive D is Data Volume Serial Number is F217-BC95 Directory of D:\ 05/07/2013 16:21 4,003,560 derp.exe 1 File(s) 4,003,560 bytes

Running the code works as expected, not that it's doing much. As explained pp creates a self extracting executable so you can basically unzip it using 7zip (or similar) to see what's inside.

Note well the other PAR/pp debugging advice given over the last few days.

Update: slight reword of the -x usage explanation.

Update 2: substitute your perl code for mine, convert as above and report back any problems.

Replies are listed 'Best First'.
Re^10: making perl executable
by Anonymous Monk on Jul 08, 2013 at 06:13 UTC
    Thank you for your help , it seems to work fine but what happens : in my script I have given a choice to user to enter either yes or no , and if he enters anything else the cmd will display "wrong choice please enter again " , but in executing the executable file , the msg is displayed and within flash of a second command prompt closes , without giving user the time to read it . so how can I avoid it

    and one more question , Is it possible for me to make this script work on any windows OS , say for instance windows 7 , XP both