while (<>) { $num ="2"; $eq = "=="; /(\d+).*/; if ($num $eq $1) { print "match\n"; } }