in reply to accessing elements of reference to hash of arrays

Hi, I would suggest, for a start, that you change this part:
} elsif (ref($aref) eq “HASH”){ #This foreach of the hash ref doesn't print anything! foreach $key ( keys %{$aref} ){
to something like this:
} elsif (ref($aref) eq “HASH”){ print "Entering the hashref branch: \n"; foreach $key ( keys %{$aref} ){ # ... } else { print "Not entering the hashref branch: ", ref($aref), "\n +";
At least, this will give you a disgnostic from where to continue. Or, else, you might also use the Perl debugger. Or the Data::Dumper module.