my $str1 = qr(C); my $str2 = qr(X); my $alert = 0; while (<DATA>) { $alert = 1 if /$str1/; $alert = 0 if /$str2/; } print "P A N I C" if $alert; __DATA__ A B C D E F
In reply to Re: Detect Two Strings in File
by Loops
in thread Detect Two Strings in File
by omegaweaponZ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |