I need to make a conditional on a regular expression match. How can I
do that?

E.g. in the code below, it prints all lines, and NOT only the ones
that match. How can I make the boolean test correct?

#!/usr/bin/perl -w
open FILEHANDLE, "soatest.soa";
while (<FILEHANDLE>){
    if (/^\*| XI/) {
        print "match in line: $.\n";
    }
}


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to