in reply to search for blank lines by RegEx

Not an answer to your question (what is in $line, anyway?), but the only effect the //s flag has is to make . match newlines. If you don't have a . in your pattern, the //s does nothing.