« use.perl | Main | Java and Perl: inline is evil »

IO::All is evil

So I was reading IO::All documentation. It seems pretty powerfull and can save me some time whenever I need to read text and parse it.

Until I came to this:

    A Tiny Web Server

Here is how you could write a simplistic web server that works with
static and dynamic pages:

perl -MIO::All -e 'io(":8080")->fork->accept->(sub { $_[0] < io(-x $1 ? "./$1 |" : $1) if /^GET \/(.*) / })'

No, I won't tell you how it works. I had to read the explanation three times to understand it all. See for yourself in the IO::All perldoc.

Contacts

melo@simplicidade.org (XMPP/email)
+351 302 029 050 (voice)
melopt (Skype)

IronMan challenge

Iron Man badge Are you ready to be an Iron Man? Join the challenge and find out! (what is the meaning of this little man?)

Moosaico

Junta-te!

Recent Comments

Powered by Disqus
Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.2