in reply to Re: Re^2: A classic use of prototypes: map2
in thread A classic use of prototypes: map2

Since < is used, @$aref is correct. Using $#$aref would work if <= were used. I prefer the former. But for that case the variable shouldn't be called "last index" and in the current code (that appears to keep changing -- so I'm not claiming you were mistaken) it isn't ($rv_len).

FYI, Algorithm::Loops includes several flavors of 'mapcar' which are like map2 but take N lists and pass the items into the code block via @_. The module documentation also discusses why I chose to use prototypes despite usually avoiding them.

- tye        

  • Comment on Re^4: A classic use of prototypes: map2 (<)