in reply to Perl GREP
One way to express an "and" with grep is just like the command line version, grep of a grep:
if (grep{!/;$/}grep{/$Function\(\)/i}}<FILE>)
or
if ( grep {/$Function\(\)/i and !/;$/}<FILE>)
Perl grep could have been called "filter", if the condition is true, the output is passed unchanged from the input (on the the right) to the output (on the left). The scalar form, like this one is, is the number of matches, not just simply a true or false condition. Here things that end in ';' are filtered out after they have satisfied the first condition.
You can put any conditional you want within a Perl grep,
grep {isMyMomsBirthdayTrue() and /SomeName/}@data;
|
|---|