in reply to Making a standalone executable

It seems to me all you need is a perl script that slurps something from STDIN (or a file?), and then uses eval() to execute that something. Then use pp to wrap that tiny script up with the modules you know you'll be needing and that's it. Sort of a custom flavored portable perl. Here's the concept code, untested:

#!perl use strict; use warnings; local $/; my $script = <STDIN>; eval($script);

Or maybe I missed something :-)

-- FloydATC

Time flies when you don't know what you're doing

Replies are listed 'Best First'.
Re^2: Making a standalone executable
by Uggles (Novice) on Jun 03, 2013 at 18:11 UTC

    I think the problem was that I wasn't adding the custom module file using the add module function with pp. I have an executable that works on my computer, but the executable has a camel logo. I'm assuming that means that it is associated with perl in some way. I'm trying to see if it works on a computer without perl installed right now, but it doesn't seem like it does. Am I just not including the interpreter in the executable?

    Here's the line of code that I wrote to create the executable:

    pp -M "custom module" -o filename.exe perlscript.pl

      As a side note to your post, the camel logo is the default provided by pp. You can specify another icon of your choosing: pp -i yourappicon.ico .....

      .
Re^2: Making a standalone executable
by Uggles (Novice) on Jun 03, 2013 at 18:24 UTC

    Nevermind, it looks like it works. I was getting compatibility errors when trying to run it on a computer without any sort of perl interpreter before, but that was because it was 32 bit. It worked on a 64 bit machine. Is there any easy way to create the same executable except make it 32 bit?

      It sounds like you used a 64 bit version of Perl to create your executable. In that case, you built a 64 bit executable, which can only be used in 64 bit Windows. Unless you need the 64 bit features of 64 bit Perl, you can install and use 32 bit Perl in 64 bit Windows. If you use 32 bit Perl to create your executable via pp, your executable can be run from both 32 bit and 64 bit Windows.

        Awesome, thank you.