Re: RFC 110 (v3) counting matches

[email protected] (Nathan Wiger)
Newsgroups perl.perl6.language.regex
Message-ID <[email protected]>
Tom Christiansen wrote:
>
>     $count = getpwnam("tchrist")/l;
>     $count = getpwnam("tchrist", LIST);
>     $count = getpwnam("tchrist")->as_list;
> 
> All of those, frankly, suck.  This is much better:
> 
>     $count = () = getpwnam("tchrist");

Hmmm. I agree a general purpose mechanism is good, but in this case we
already have "scalar" so why not "list"?

    $count = list getpwnam("tchrist");

While I agree that /l is bad, I think going through the crap of "= () ="
is even worse. Does it work? Yes. But is it easily usable and fun, even
for non-experts? No.

-Nate
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.