note
ggoebel
<p>When you have the time read <a href="http://perldoc.perl.org/perlre.html">perlre</a></p>
<p>If you're in a rush... skip down to the section on "Quantifiers". TIMTOWTDI. Pick the way which you think you'll stand the best chance of understanding 3 weeks or 3 months from now when you're asked to tweak your code.</p>
<p>Both:</p>
<code>
$work =~ s/\s+$/ /; # more than once
</code>
<p>and</p>
<code>
$work =~ s/\s{2,}$/ /; # at least twice
</code>
<p>should work.</p>
1021620
1021620