note
rkg
Thanks for the <code> $text =~ s/\[[^\]]*\]/ /g;
</code> tip; that is better. As for the <code> /m </code>
on these <code>
$text =~ s/^\s+//;
$text =~ s/\s+$//;
</code> I think I'd put the <code> /m </code> on the <em>third</em> RE
<code>
$text =~ s/\s+/ /m; #yes?
</code>
so taken together the triple REs mean: "remove leading whitespace, trailing whitespace, and make all interior whitespace (even across line breaks) into single spaces".
<p>
Many thanks for the OT-but-useful teaching!
<p>
[rkg]
290025
290582