in reply to Re: Save hash value?
in thread Save hash value?

...say whut? Would you mind explaining more about that? What I need to do, is merge all dupes(the data of the entries), not just remove them. Btw, Anonymous Monk, now I get what you mean and it worked ;) thx!

Replies are listed 'Best First'.
Re^3: Save hash value?
by chromatic (Archbishop) on Jun 06, 2011 at 01:38 UTC

    I assume you create @players somehow. If you have a loop in which you do so (or if you can arrange your code to create some sort of loop), you could make a hash instead of an array and write:

    my %players; while (my $player = make_next_player()) { if (exists $players{ $player->{name} } { # merge new player data with existing player } else { $players{ $player->{name} } = $player; } }