Wiki in Four Lines of Perl is Short, Cryptic

| Comments

I think we can all admit to taking a shot or two at Perl Guys from time to time: I like to do it with a thick east-European accent. “Vat? You need billing system? I write in Perl. Ten lines.”

Well who’s laughing now? Here’s Sig Wik, a wiki in four lines of Perl. Four!

#!/usr/bin/perl
use CGI':all';path_info=~/\w+/;$_=`grep -l $& *`.h1($&).escapeHTML$t=param(t)
||`dd<$&`;open F,">$&";print F$t;s/htt\S+|([A-Z]\w+){2,}/a{href,$&},$&/eg;
print header,pre"$_<form>",submit,textarea t,$t,9,70

This all comes courtesy of the Shortest Wiki Contest. Good food for thought in the whole brevity vs. clarity thing.

blog comments powered by Disqus