A rewrite of fuzzycd in Perl