add Perl implementation