while () { my $code = (split)[1]; print if grep $_ eq $code, @all; } }