in reply to regexp for blank lines

#strip off carriage returns $line=~s/[\r\n]+$//s; #next if the length of $line is zero next if length($line)==0;

Replies are listed 'Best First'.
Re^2: regexp for blank lines
by eyepopslikeamosquito (Archbishop) on Dec 14, 2004 at 08:25 UTC
    $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....