in reply to Re: the ? : operator : a bug ?
in thread the ? : operator : a bug ?

From perldoc -q map

Found in /System/Library/Perl/pods/perlfaq6.pod

What's wrong with using grep or map in a void context?

Both grep and map build a return list, regardless of their context. This means you're making Perl go to the trouble of building up a return list that you then just ignore. That's no way to treat a programming language, you insensitive scoundrel!

That's in 5.6.0, but apparently it's changed in 5.8.0, go figure.

Replies are listed 'Best First'.
Re: Re: Re: the ? : operator : a bug ?
by Sihal (Pilgrim) on Nov 22, 2002 at 08:53 UTC
    :-) Sorry.
    But actually the root of evil was that I didn't really understand how ? : worked. I thought of it as a nice shortcut but didn't see how it really worked. Which is why I was puzzled yesterday.