Perl Monk, Perl Meditation | |
PerlMonks |
Re: array splittingby l.frankline (Hermit) |
on Jun 06, 2007 at 07:54 UTC ( [id://619552]=note: print w/replies, xml ) | Need Help?? |
@times = (5, 10, 20, 25, 30, 40, 45, 50, 55, 65, 75, 80, 90); @times1 = (); @times2 = (); $sw = 1; map {if ($sw == 1) {push (@times1,$_);$sw = 0;} else {$sw = 1;}} @times; $sw = 1; map {if ($sw == 0) {push (@times2,$_);$sw = 1;} else {$sw = 0;}} @times; Don't put off till tomorrow, what you can do today.
In Section
Seekers of Perl Wisdom
|
|