![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re: match two elements from an array in a rowby dogz007 (Scribe) |
on Aug 16, 2007 at 22:25 UTC ( #633186=note: print w/replies, xml ) | Need Help?? |
You could use List::Util and take advantage of reduce:
Prints:
Update: If you would prefer to use a for loop, you should use the range operator as below. Much cleaner to read. I guess I got carried away with the reduce.
In Section
Seekers of Perl Wisdom
|
|