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