http://www.perlmonks.org?node_id=120831


in reply to Win32 executable AS PerlApp, perl2exe, perlcc, ??

Why play silly tricks that have been shown to break scripts. Why pay money? Add END { print join( $/, values %INC ), $/ } to your script. Copy your Perl directory. Delete most modules not mentioned by the above output from the copy. Try your script on the copy. Recopy any parts that you shouldn't have deleted. Put your script into the "bin" subdirectory. Put "bin/perl bin/script" into "run.bat" in the main directory. Zip it up.

All you friend will need to do is unzip the results into any directory they like and "run".

The other methods you mention do basically the same things except they try to be tricky about how they extract the files so that it doesn't look like that is what is going on. The "being tricky" part can break scripts in strange ways (though scripts often will continue to work).

Granted, the automation of determining what to keep and what to delete is kind of nice (except when it guesses wrong), but it isn't worth the price and the potential breakage to me.

By not "installing" Perl, about all that is different is that "perl.exe" is not in the $ENV{PATH} and *.pl files are not flagged as being Perl scripts. I'm not sure what policy allows your friend to copy files but not "install" Perl, but this copying won't allow Perl to be used by malware unless the malware does something whacky like search the entire hard disk hoping to find Perl (which isn't going to happen), so that probably means it shouldn't be a problem for such a policy.

You can even skip the "delete" step. It isn't that likely to save your friend all that much space anyway. Also, start with IndigoPerl from IndigoStar. It comes as a simple *.zip file so you'll get a script that can be used to "install" Perl after everything has been unzipped. That way your friend has the option to later decide to "install" Perl w/o downloading anything extra.

        - tye (but my friends call me "Tye")