I need to perform a conditional on a regexp match. How can I do that (easily) in PERL. The following prints out all lines - also the ones, that doesnt match the regular expression. open FILEHANDLE, "soatest.soa"; while (<FILEHANDLE>){ if (/^\* XI/) { print "match in line: $.\n"; }