more useful options | |
PerlMonks |
Re: Grep reutrn the occurance of a patternby moklevat (Priest) |
on Mar 13, 2008 at 13:56 UTC ( [id://673967]=note: print w/replies, xml ) | Need Help?? |
To get the number of matches you evaluate grep in scalar context. Here:
Prints 3. Update: Noticed that I left out @items, and I see I am not alone in my confusion about exactly what it was the OP wanted.
In Section
Seekers of Perl Wisdom
|
|