Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: array splitting

by l.frankline (Hermit)
on Jun 06, 2007 at 07:54 UTC ( [id://619552]=note: print w/replies, xml ) Need Help??


in reply to array splitting

@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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://619552]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-26 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found