in reply to array element question

If you don't mind clobbering the array or copying it to a temporay version then you can:

use strict; use warnings; my @array = <DATA>; chomp @array; for my $index (0 .. $#array) { next unless $array[$index] =~ /'/ && exists $array[$index + 1]; $array[$index] .= $array[$index + 1]; $array[$index + 1] = ''; } @array = grep {length} @array; print join "\n", @array; __DATA__ I' m guessing I' d use join somehow

Prints:

I'm guessing I'd use join somehow

DWIM is Perl's answer to Gödel