Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: extracting only those keys with uniq values in array list

by davido (Cardinal)
on Apr 20, 2021 at 15:50 UTC ( #11131517=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %hash = (
        foo  => ['this', 'that'],   # Two different values
    ...
        baz  => ['the', 'other'],   # Not the same
        buzz => ['same', 'same'],   # The same
    );
    
  2. or download this
    my %hash = (
        foo  => ['this', 'that'],   # Two different values
    ...
            print "$key\n";
        }
    }
    
  3. or download this
    if (2==@$aref && $aref->[0] eq $aref->[1]) ...
    
  4. or download this
    while (my ($key, $aref) = each %hash) {
        my %seen;
    ...
        next if 1 != keys %seen;
        print "$key\n";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11131517]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2021-06-18 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (89 votes). Check out past polls.

    Notices?