[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] Iternating over multiple lists



The recent thread about incrementing a list got me thinking about the 
more general underlying problem...  I don't have a really good 
solution (other than the obvious brute-force approach) but perhaps it 
is something that a 'fun' approach can be found for:

What perl needed to make the solution to this problem trivial (and 
elegant) is "multiple map" (or, if you rather "parallel map").  That 
is, imagine if you could do:

   mmap {BLOCK} list1 list2 list3 list4 ....

and BLOCK would be evaluated with $1, $2, $3, $4, ... all bound to 
corresponding elements from each of the lists.  [Yes, I know you 
can't pass lists around that way... just kicking around an idea.. 
maybe you'd have to do it with a list-of-references-to-lists or some 
such]

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
mailto:bernie@fantasyfarm.com     Pearisburg, VA
    -->  Too many people, too few sheep  <--          

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe