says perldoc -f grep
In scalar context, returns the number of times the expression was true.And watch your language ;) a list evaluated in scalar context does not give its length my $len = (3,4,5); # $len == 5 ! only an array gives back its length in scalar context.
It would be very inefficient to first build up an array with lots of elements and then only use its length. That's why only a number is returned directly.
-- Hofmator
In reply to Re5: IF NOT! IF NOT!
by Hofmator
in thread IF NOT! IF NOT!
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |