--- Michael Lazzaro <[EMAIL PROTECTED]> wrote:
> Arrays have methods:
>
> my int @a = (1..100);
> print @a.length; # prints "100"
> my @b = @a.grep { $_ > 50 }; # gets 51..100
.length is unneeded, since an array gives its length in numeric context, so
you can just say +@a. grep shouldn't be an array method either, it should be
like the perl5 grep, as it is often used on lists, "grep /foo/, keys %h" is
far more readable than "@{[keys %h]}.grep(/foo/)".
Some things should be methods on arrays though, like push, pop, shift,
unshift, and splice, since those are only for real arrays anyway.
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com