next unless (/class\h*=\h*['"]data['"]/); # \h is horizontal white space
next unless (/id\h*=\h*['"](\w+)['"]/);
$out .= ", $1=";
$nest = 1 if ($nest == 0); # if this is the outer most interesting
next;
}
$nest--, next if (/^<\/div/);
next if (/^[<]/); # skip other mark-up
$out .= $_ if ($nest > 0);
}
$out =~ s/^, //;
say "$out\n";