Here's my riff on wind's illustration:

#!perl

use strict;
use warnings;
use utf8;
use open qw( :utf8 :std );

my @players = qw( Bob Carol Ted Alice );
my @deals;   # Array of hashes of cards (values) dealt to players (keys)
my %hand_of; # Hash of arrays of cards in players' (keys) hands

push @deals, { Bob   => '7♦' };
push @deals, { Carol => 'K♣' };
push @deals, { Ted   => '2♥' };
push @deals, { Alice => '4♥' };

push @deals, { Bob   => 'A♣' };
push @deals, { Carol => 'Q♣' };
push @deals, { Ted   => '3♦' };
push @deals, { Alice => 'J♠' };

push @deals, { Bob   => '5♠' };
push @deals, { Carol => 'A♠' };
push @deals, { Ted   => '9♣' };
push @deals, { Alice => 'K♦' };

push @deals, { Bob   => '3♠' };
push @deals, { Carol => 'Q♠' };
push @deals, { Ted   => 'J♦' };
push @deals, { Alice => '6♦' };

push @deals, { Bob   => 'Q♦' };
push @deals, { Carol => 'Q♥' };
push @deals, { Ted   => '7♠' };
push @deals, { Alice => '5♦' };

for my $deal (@deals) {
    my ($player, $card) = %$deal;
    push @{ $hand_of{$player} }, $card;
}

for my $player (@players) {
    my $hand = join ' ', @{ $hand_of{$player} };
    print "$player has $hand\n";
}

__END__
Bob has 7♦ A♣ 5♠ 3♠ Q♦
Carol has K♣ Q♣ A♠ Q♠ Q♥
Ted has 2♥ 3♦ 9♣ J♦ 7♠
Alice has 4♥ J♠ K♦ 6♦ 5♦


In reply to Re: 'group by query' from array of hashes by Jim
in thread 'group by query' from array of hashes by bplegend

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.