Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
s[^\s*(.*)\b\s*$][$1] Update: Corion rightly points out that this does not work correctly for lines where the last non whitespace character is a non-words character. Eg.
So, use s[^\s*(.*\S)\s*$][]; instead. It's slower, but still quicker than the FAQ method. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?
In reply to Re: trim leading & trailing whitespace
by BrowserUk
|
|