foreach my $sub_ref (keys %test_procs){ foreach(@procs){ print "$test_procs{$sub_ref}\n" if $sub_ref eq $_; } }