Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: split every other value

by Aristotle (Chancellor)
on Aug 07, 2004 at 00:32 UTC ( [id://380790]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while( @array ) {
        my ( $even, $odd ) = splice @array, 0, 2;
        push @odd, $odd if defined $odd;
        push @even, $even if defined $even;
    }
    
  2. or download this
    ( $even[ @even ], $odd[ @odd ] ) = splice @array, 0, 2 while @array;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-25 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found