in reply to Re^2: Not a HASH reference error
in thread Not a HASH reference error

If you know the pseudo-hashes are empty of data then a simple check and skip might suffice

foreach my $type (@type_order) { print "$log_pre running $action for $type entries\n"; # Iterate over all items of that type my $type_hash = $hashref->{$type}; next unless ref($type_hash) eq 'HASH'; # <-- add

If you are not sure then use

foreach my $type (@type_order) { # Iterate over all items of that type my $type_hash = $hashref->{$type}; if ( (ref($type_hash) eq 'ARRAY') && (@$type_hash<2) ){ print "Skipping empty pseudo-hash for $type entries\n"; next; } else { print "$log_pre running $action for $type entries\n"; } . .
poj

Replies are listed 'Best First'.
Re^4: Not a HASH reference error
by briandanderson1977 (Novice) on Feb 26, 2016 at 23:06 UTC

    Thank you, Poj. What is really strange is this works just fine on another RHEL v6 server. But not on this one. Same syntax, everything. I'll try your recommendations and see what happens. Thanks again.