add the function in Perl and tweak README.md