Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

How can I get the unique keys from two hashes?

by faq_monk (Initiate)
on Oct 08, 1999 at 00:20 UTC ( #631=perlfaq nodetype: print w/ replies, xml ) Need Help??

Current Perl documentation can be found at



    %seen = ();
    @uniq = keys %seen;

Or more succinctly:


Or if you really want to save space:

    %seen = ();
    @uniq = keys %seen;

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-12-29 01:27 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (183 votes), past polls