Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Favourite One-liners?

by epoptai (Curate)
on Jun 28, 2005 at 19:47 UTC ( #470797=note: print w/ replies, xml ) Need Help??


in reply to Re: Favourite One-liners?
in thread Favourite One-liners?

FYI LWP::Simple can get and print with one command:

perl -MLWP::Simple -e "getprint 'http://www.perlmonks.org'"
Here's a webserver, from the IO::All docs:
perl -MIO::All -e 'io(":8080")->fork->accept->(sub { $_[0] < io(-x $1 +? "./$1 |" : $1) if /^GET \/(.*) / })'

--
perl -MO=Deparse -e"u j t S n a t o e h r , e p l r a h k c r e"


Comment on Re^2: Favourite One-liners?
Select or Download Code
Re^3: Favourite One-liners?
by mhacker (Sexton) on Jun 29, 2005 at 14:57 UTC
    One line web server? Way cool.

    A couple of years ago I went back to uni for a network communication class I failed once. After completing the lab assignment of writing a "time-of-day" server in C, I showed the lab instructor the equivalent perl code (one-liner). He thought it was pretty cool (I know, the lab goal is not the end result, but the methods you use to get there, but still..)

    Had I known about IO::All and one-line web servers at the time, I might have gotten extra points on the lab assignment :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://470797]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2014-08-22 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (152 votes), past polls