$line=~s/[\r\n]+$//s;
To nitpick, the /s modifier above is meaningless; the only effect of /s is to change whether the . (dot) metacharacter matches newline or not. If a pattern does not contain a dot, then /s is meaningless, by definition. See also Re: S And M -- modifiers, that is....
In reply to Re^2: regexp for blank lines
by eyepopslikeamosquito
in thread regexp for blank lines
by cspears
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |