I'm looking for a quick and dirty, but compatible and
reliable, way to download and run a Perl program in
one simple, cut-and-paste-able line. So far, I've come up
with is:
perl -e 'eval `lynx --source http://theurlfortheprogram/`'
Obviously, what you get at the URL is a Perl program without
HTML formatting, such as you would get if you did this:
$ ln -s perlprogram index.html
I had tried a few variations, but piping from lynx to perl,
for example, seemed to take over STDIN, rendering it
useless for user input. During some experimentation, I
discovered a similar technique used at
Ximian, where
they had
used
sh instead, but with a pipe, presumably because
their installer isn't interactive on the command line.
This is so that I can download and run a Perl program which
fixes up things to that they work (i.e PATH, .cshrc,
.bashrc) among other things, such as hauling over a kit of
standard goodies, toys, and projectiles to put into ~/bin.
The question is, is there an easier/better way?
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.