What I always used to do 

my $data = {};
my $sth = $dbh->prepare(
    'SELECT name, colour, shape FROM thing WHERE smell=?'
);
$sth->execute('bad');
while ( my $row = $sth->fetchrow_hashref ) {
    $data->{$row->{colour}}{$row->{shape}} = $row;
}
my $data = $dbh->selectall_hashref(
    'SELECT name, colour, shape FROM thing WHERE smell=?',
    [qw(colour shape)],
    undef,
    'bad'
);