http://www.perlmonks.org?node_id=11131514


in reply to extracting only those keys with uniq values in array list

For every key($r_name) , I have 2 values. I want to print the names of those keys($r_name) where the 2 values for a particular key($r_name) are same. If the 2 values for the particular key are different from each other, then I do not want to output that key.
use strict; use warnings; use Test::More tests => 1; my %read2seq = ( foo => [123, 123], bar => [456, 789] ); my @want = ('foo'); my @samevals = grep { $read2seq{$_}->[0] eq $read2seq{$_}->[1] } keys +%read2seq; is_deeply \@samevals, \@want;

🦛