Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Splitting on change

by Fletch (Bishop)
on Dec 08, 2005 at 16:25 UTC ( [id://515286]=note: print w/replies, xml ) Need Help??


in reply to Splitting on change

Kludgy, but you could use what you've got and append every even element to the preceding odd element.

my @result; while( my( $o, $e ) = splice( @tmp, 0, 2 ) ) { push @result, $o . $e } print join( "\n", @result ), "\n";

Update: Bleh, ignore me. Look at the other suggestions. Now where'd my caffeine go . . .

Log In?
Username:
Password:

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

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

    No recent polls found