Correct me if I'm wrong, but, by analogy with $foo.bar(), ...

>     No          Yes
>     --          ---
>     @foo        @foo[1]
>     %bar        %bar{"a"} or %barŤať
>     $foo.bar    $foo.bar()
>     &foo        &foo(1)
      @foo        @foo.join(" ")

Yes?

/me idly wonders whether map and grep and sort could be made into
methods on the array class and chained together and interplated as
such...

print "@foo.map({[$_,wibble($_)]}).sort([EMAIL PROTECTED] cmp @$b[1]}).map([EMAIL 
PROTECTED])";

Ugh, that looks horrible.  Of course, one could probably define a
.schwartz() method on the array class and do the above thusly...

print "@foo.schwartz({wibble($_)},{$a cmp $b})";

That doesn't buy you the flexibility to throw in extra steps (like a
grep in the middle), but it sure is easier to read.  

Of course one could argue that sensible people would assign the
processed list to an array variable first and then interplate that...

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,"[EMAIL PROTECTED]/ --";$\=$ ;-> ();print$/

Reply via email to