I was experimenting today with making executable files out of Perl scripts.
I post regularly on boards and the members wanted a way to download and archive the contents.
I've inherited a useful script, which is barely twenty lines, but it requires LWP::userAgent.
A lot of people would like to be able to use this script without having to install Perl.
There's a company that makes a thing called "Perl2EXE" which can make any script into a Windows executable. I did a version of it using that, which was not small, but worked. (It's demo-only ware, and I haven't paid up, but this is just an experiment)
Then I tried to come up with a Mac version. There's such a thing as a runtime file which can be saved from a MacPerl script, but when I tried, the one line "use LWP::UserAgent;" sent me off on a chase through about twenty different modules.
You can't use LWP::UserAgent without various parts of HTTP:: and HTML:: and Exporter.pm and about fifty other things. By the time I'd ferreted through the modules I'd need to include in a special "lib" directory, it would have been easier to just say "Download MacPerl", come back, then run this script.
So do I have a question? Maybe it's
- There must be something very smart about the Perl2EXE software if it can find all the modules and all the modules that the modules call on and the modules that they call on in turn -- is there anything like that freely available? And does Perl2EXE somehow compile them into binaries, rather than including them wholesale?
- Did the modules that I needed to use for my simple hit-on-a-page, munge-the-source script really need every line of those modules, or was it just a cascade of "require" statements? Could I have got away with just 10% of HTTP::Whatever and less than half of CGI::SomethingElse, if I'd had an even smarter tool to grab only the parts I'd really needed?
--
Weaselling out of things is important. It's what separates us from the animals ... except the weasel.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.