in reply to what is keys %$hash_ref [-1]

Here's another guess along the lines of "Maybe if I add some more stuff, it'll be a valid statement":

>perl -wMstrict -le "my @hash_ref = ({ qw(a 1 b 2) }, { qw(c 3 d 4) }); ;; print keys %{ $hash_ref [-1] }; print values %{ $hash_ref [-2] }; " cd 12