我的問題:remove元素加入數組結果
@array = (possible text,
text surrounded with round brackets,
text without brackets,
text surrounded with round brackets,
possible text);
$line = join(' ', @array);
我想刪除,如果在第一支架之前的任何文字和加入結果(可能的文本)的最後括號後的任何文本。 謝謝。
真正的代碼:
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);
請張貼真實密碼? – 2011-09-10 12:24:22
同等重要:後期示例輸入數據和期望的輸出。 – FMc