in reply to RE: scalarmap - some new perl syntax
in thread scalarmap - some new perl syntax

An advantage to $a and $b is that they [utomatically pass strict. (Specifically because of sort.)

This is also a disadvantage, but oh well.

  • Comment on RE (tilly) 2: scalarmap - some new perl syntax

Replies are listed 'Best First'.
RE: RE (tilly) 2: scalarmap - some new perl syntax
by ncw (Friar) on Sep 01, 2000 at 11:32 UTC
    That is why I chose $a and $b, because of the sort magic.

    I did consider setting $_ to a 2 element anonymous array, then you'd use it like this.

    scalarmap { $_->[0] + $_->[1] } 0, @z;
    But that isn't as elegant.

    I considered using $a and $_ but that offended me too!

    I see from merlyn's post below that the maker of List::Util::reduce came to the same conclusions...