More work for porting

Perl is an awesome language btw.