Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Replacing whitespaces with a regex

by ggoebel (Sexton)
on Mar 04, 2013 at 13:51 UTC ( [id://1021643] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    $work =~ s/\s+$/ /; # more than once
  2. or download this
    $work =~ s/\s{2,}$/ /; # at least twice