My problem:
@array = (possible text,
text surrounded with round brackets,
text without brackets,
text surrounded with round brackets,
possible text);
$line = join(' ', @array);
I want to delete, if there is any text before the first bracket and any text after the last bracket of the join result (possible text).
Thanks.
real code:
my (@lines, $line, $anchor, $left, $right, $parent, $elem);
($anchor) = $tree->look_down(_tag=>"span", class=>"txt");
if ($anchor) {
$elem = $anchor;
my ($product, @tmp);
while (($elem = $elem->right()) &&
((ref $elem) && ($elem->tag() ne "table"))) {
@tmp = get_all_text($elem);
push @lines, @tmp;
$line = join(' ', @tmp);
See if this works for you: