The 17th IOCCC is Now Open!
SimonCooper inputs: "Are you frustrated with software bloat? If so then you might want to consider submitting a little something to
The 17th International Obfuscated C Code Contest. The contest is now open for submissions and runs from midnight Jan 7th, 2004 through the end of 29th Feb 2004 (all times in UTC!). Later on in January it will be possible to submit entries using a web form."
> any application in Perl that's over 100 lines
You do realize, do you not, that 100 lines is a whole lot of Perl. I know, in
C that's barely enough to declare your data structures for a medium-sized
CGI script, but a Perl program tends to be shorter. (There *are* really
large apps written in Perl (Bugzilla comes to mind), but if they were written
in C they'd be 2-10 times larger, depending on what they do.)
For example, consider an application that connects to the slashdot web server,
retrieves the main page, fills in the username and password, submits the form,
extracts the list of headlines from the result, checks them against a MySQL
database to see which ones are new since last time, displays those, and then
sleeps for some predetermined amount of time. In C, that's probably well over
100 lines of code. In Perl, we write that in ten lines and play golf with it.
Yeah, that's using a couple of modules from the CPAN, but that's roughly the
equivalent of includes in C, and I *know* you don't want to try the above in
C without including some string handling libraries.
Cut that out, or I will ship you to Norilsk in a box.
> In Perl, we write that in ten lines and play golf with it.
c alhost", 'dbuser', 'dbpasswd', {'RaiseError' => 1});) ;l ashpass'); $m->click();
In fact...
use WWW::Mechanize; use DBI; $\=$/;
my $dbh = DBI->connect("DBI:mysql:database=slashdot;host=lo
my $query = $dbh->prepare("SELECT * from headlines WHERE title=? and seen='yes'");
my $update = $dbh->prepare("INSERT INTO headlines SET seen='yes', title=?");
while (1) {
($m = WWW::Mechanize->new())->get("http://slashdot.org"
$m->form_number(1); $m->set_fields(unickname=>'slashuser',upasswd=>'s
for (($m->content()) =~ m/size="?4[^>]*><b>(.*?)<\/b>/ig ) {
$query->execute($_); (print and $update->execute($_)) unless $query->fetchrow_array() }
sleep 10 }
Cut that out, or I will ship you to Norilsk in a box.