in reply to Parsing the data returned from the companies house API

You are checking the $key, which is always a string. You should have been checking the value corresponding to the key:
for my $key (keys %$decodedJSON) { if (is_hashref($decodedJSON->{$key})) { print "$key is another hash\n"; } elsif(is_arrayref($decodedJSON->{$key})){ print "$key is an array ref\n"; } else{ print Dumper($key); print "$key is neither a hashref nor an arrayref\n"; } }

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]