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
In reply to Re: array element question
by GrandFather
in thread array element question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |