in reply to How to remove extra line breaks (using regexp)?

Would this work?
#!/usr/bin/perl use strict; my @file = <DATA>; foreach my $i (@file) { $i =~ s/\n/ /; $i =~ /^A\d\.\d\./ ? print "\n$i" : print $i; } __DATA__ A6.8.5 This is an example sentence A6.8.6 This is an example sentence

Replies are listed 'Best First'.
Re^2: How to remove extra line breaks (using regexp)?
by Anonymous Monk on Apr 18, 2009 at 07:39 UTC
    yes, it works, thanks