my %all = map +( $_ => 1), qw(7723 7725 9908 7765 7874); $all{ (split)[ 1]} and print while ;