undef $/; $a = ; $search = 56; if ($a =~ /(\w+)\n$search/) { print "matched: $1"; } __DATA__ NP 32 U 56