Started rewrite in perl.
Started rewrite in perl.