Add Perl implementation

Just for fun. Thanks.