in reply to another problem with the blank line regex

First, if you're using DOS-type files, the lines are separated by "\r\n" instead of just "\n". You might have to tackle this as well. Of course, were you on one of those systems, your $/ would be set accordingly. Try this?
$lines =~ s#($/)+#$/#g;
The /m and /s flags seem to be a little extraneous given your specific circumstances. /m is used to modify the behaviour of ^ and $ within the regex, /s to modify how . is processed. See perlre for more details.

As a note, this is virtually identical to some of the replies you received for remove blank lines with regex, so why you posted again is unclear.

Replies are listed 'Best First'.
Re: Re: Another Problem Removing Blank Lines
by amarceluk (Beadle) on May 21, 2002 at 18:00 UTC
    All the previous responses do work, they just only work on the last two lines of the file. I was wondering if there was a simple Perl-related explanation for it.

    I'm sorry if I'm posting too much, I don't mean to be annoying. I debated long and hard over whether to post again, and finally decided to because otherwise I'd just sit around worrying about it.