Because grep evaluated in scalar context (as you are doing) returns the number of elements of the input list that satisfy the condition.
Give a man a fish: <%-{-{-{-<
In reply to Re: grep surprise
by AnomalousMonk
in thread grep surprise
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |