#!/usr/bin/perl use strict; use warnings; use diagnostics; my %test = ( sup => [ { name => 'Fooname', ident => 'foo', }, { name => 'barname', ident => 'bar', }, ], ); my $match = map {$_->{ident} eq 'bar' ? $_->{name} : ''} @{$test{sup}}; print "'$match'\n";