Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Remove duplicates from Hash of Arrays

by Kenosis (Priest)
on Dec 09, 2013 at 20:42 UTC ( #1066332=note: print w/replies, xml ) Need Help??

in reply to Remove duplicates from Hash of Arrays

Perhaps the following will be helpful:

use strict; use warnings; my %h; my $HoA = { 'music' => [ 9, 53, 3, 15 ], 'conferences' => [ 7, 56, 15, 53 ], }; @h{@$_} = undef for values %$HoA; my @ids = keys %h; print "@ids"; # 53 56 3 7 9 15

What is this @h{@$_} = undef notation? See Hash from two arrays.

Replies are listed 'Best First'.
Re^2: Remove duplicates from Hash of Arrays
by Anonymous Monk on Dec 09, 2013 at 22:00 UTC
    Thanks, I will use this. After some reading up it seems setting each key to undefined can save memory when dealing with large arrays, as I sometimes will be.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1066332]
[trahulprajapati]: I'm faicing a problem while navigating from one page to another. here is the discription- 1)I want to login webpage 2) on next page click okay 3)then next page fill some text in textbox 4) submitt. I have tried it by WWW::Scripter:: Javascript as page

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2017-06-26 15:13 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (583 votes). Check out past polls.