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