in reply to Removing whitespaces,tab,line breaks, etc?

$string =~ s/\s+/ /gs;
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re: Re: Removing whitespaces,tab,line breaks, etc?
by FamousLongAgo (Friar) on Jan 09, 2003 at 15:21 UTC
    The s modifier is superfluous here.

      You're absolutely right of course. The clue was that /s only ever modifies the behaviour of '.' and my regex didn't include a '.'.

      --
      <http://www.dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg