> "David L. Nicol" wrote:
> [...]
> > No, that does not work:
> > 
> > perl -le '@solids=(1..7);@stripes=(9..15);\
> >         for (\@stripes, \@solids){\
> >             print "$_->[0] and  $_->[1] are the same color"\
> >         }'
> > 
> > 9 and  10 are the same color
> > 1 and  2 are the same color
> 
> Although a "sideways" function that took N array-refs and
> returned an array of references to arrays of size N, that might
> be a very nice standard tool.  They could even be aliases instead
> of copies for use in the above syntax:
> 
>       for (sideways(\@foo, \@bar)){ ...
> 
> 
> "sideways" is not the right word for that operation on a matrix,
> what is it?

Take a look at the node "mapcar -- map for more than one list"
on perlmonks.org <URL:http://perlmonks.org/index.pl?node_id=44763&lastnode_id=44834>

mapcar {print "$_[0] : $_[1]\n";} \@foo, \@bar;

/prakash
-- 

_______________________________________________
FREE Personalized E-mail at Mail.com 
http://www.mail.com/?sr=signup 

Talk More, Pay Less with Net2Phone Direct(R), up to 1500 minutes free! 
http://www.net2phone.com/cgi-bin/link.cgi?143 

Reply via email to