in reply to Re: Converting array of hash references to hash
in thread Converting array of hash references to hash

When I check the above statement using Perl Critic, it finds the following violation. "grep" used in boolean context. I see this strange.

Replies are listed 'Best First'.
Re^3: Converting array of hash references to hash
by anirudh.agarwal (Novice) on May 01, 2013 at 09:36 UTC
    I then found that grep would search for the rest of the array even if a match is found in the first record itself. I believe any should be used. Let me try the following $ams_ip = "" unless any { $ams_ip eq $_->{'deviceIp'} } @{$ams_hosts}; Please let me know if I am wrong. Thanks :)