Translated the bash script to perl. Updated the readme