package main; use strict; use warnings; my %test = ( sup => [ { name => 'Fooname', ident => 'foo', }, { name => 'bardame', ident => 'bar', }, ], ); my @match = map {$test{sup}[$_]{ident} eq 'bar' ? $test{sup}[$_]{name} : ''} (0.. scalar @{$test{sup}} - 1); print "@match \n";