Perl is warning me about using pseudo hashs in my program:
Pseudo-hashes are deprecated
How do I convert the following code so that is does not use pseudo hashs
foreach my $hash (@arrayOfHash) {
print keys %{$hash};
}
The problem isn't in that code. The problem is that @arrayOfHash
actually contains arrayrefs, not hashrefs.
If for some reason you can't fix @arrayOfHash
, you can work around it by doing:
foreach my $hash (@arrayOfHash) {
my %hash = @$hash;
print keys %hash;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With