Perl: Added cases of reference to array and associative array