Python to Perl code converter, as the first assignment of COMP2041 14s2.