use Data::Dumper; # add this near the top of your script: # ... now, down at line 383 (had been 382 before adding "use Data::Dumper": SITEKEY: for $sitekey (sort {$a <=> $b } keys %{$matches{$fastaseq}}) { print "\$matches{$fastaseq}{$sitekey} is:\n", Dumper( $matches{$fastaseq}{$sitekey} ); # add this SET: foreach $hit ( ... ) { # the above print statement used to be here