in reply to \s vs \t

It doesn't match your tab cause it's already matched something earlier in the file. You want
s{\s+$}{}mg
rather than
s{\s+$}{}m.

Update: Removed incorrect statement about what was being matched. And added the following comment:

\s can match newlines, which produces something undesireable.
s{[\t ]+$}{}mg
does not suffer the same problem.

Replies are listed 'Best First'.
Re^2: \s vs \t
by dragonchild (Archbishop) on Jan 05, 2005 at 17:58 UTC
    Out of curiousity, how would s/\s+$// match anything to the LEFT of something other than a newline or end-of-string?

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      silly me! I kept thinking he was doing /^\s+/. It was actually matching a newline. Updated.
Re^2: \s vs \t
by marcelo.magallon (Acolyte) on Jan 05, 2005 at 17:39 UTC

    Oh.

    Thanks, I was mucking around with m and s and removed the g because it had a side effect I didn't want...

    Many thanks!