Some code I've written in Perl