in reply to replace all spaces within anglebrackets with underscores

Wouldn't it be a smidgen better to use a negative char class and a + quantifier?

s{(<[^>]+>)}{ (my $x = $1) =~ tr/ /_/; $x; }eg;