- or download this
while ($record = <INPUTFILE>) {
$_ = $record;
...
$matchesFound = $matchesFound + 1;
}
}
- or download this
while (<INPUTFILE>) {
++$matchesFound && print if (/$searchString/);
}
- or download this
while ($record = <INPUTFILE>) {
if ($record =~ /$searchString/) {
...
$matchesFound++;
}
}