Nano Wiki

A tiny Wiki implementation written in pure Perl by DrakeWilson? for the ShortestWikiContest. Source follows:

 #!/usr/bin/perl
 use CGI':all';$$_=param$_ for x,t;$z=($t&&"+>").$x;open z;print z$t
 if$t;$_=escapeHTML($t||join"",<z>);s/([A-Z]\w+){2,}/v$&/ge;print
 header,h1($x),pre($_,map{"\n".v$_}grep{open
 _;grep/$x/,<_>}<*>),start_form,textarea(t),hidden(x,$x),submit,end_form;sub
 v{a{href,url."?x=@_"},@_}

EditText of this page (last edited April 27, 2006) or FindPage with title or text search