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.


In reply to Re^9: making perl executable by marto
in thread making perl executable by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.