in reply to Remove blank lines from REGEX output

The final .* doesn't match the \n at the end of $data_line, so that doesn't get removed (perlre). One approach you can use is to add the /s modifier to the regex, so that . matches the newline. Obviously TMTOWTDI - personally I'd just make the printing of the lines conditional:

print $data_line unless $data_line=~/^[BbLl].*|^_.*|^.*\d\d\d\.\d\d\d.*/;

Replies are listed 'Best First'.
Re^2: Remove blank lines from REGEX output
by Deep_Plaid (Acolyte) on Feb 05, 2014 at 21:02 UTC

    Thanks for you help and fast reply! That does make sense.