Perl Create Hash From Array To Hashmap In Python