I have this code
if (defined($xml->{account}->{p}) == '2') { ... }
which gives me this warning
Pseudo-hashes are deprecated at a.pl line 48.
The problem is that in some cases $xml->{account}->{p} does not exist, so I added a defined function.
$xml is an object if that matters?
How can this be fixed, so Perl does not complain?
source share