in reply to Re{4}: IF NOT! IF NOT!
in thread IF NOT! IF NOT!

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

Replies are listed 'Best First'.
Re: Re5: IF NOT! IF NOT!
by dragonchild (Archbishop) on Aug 03, 2001 at 17:54 UTC
    I stand corrected. My bad. :)

    ------
    /me wants to be the brightest bulb in the chandelier!

    But isn't ... *pouts*