http://qs1969.pair.com?node_id=986284


in reply to Re^3: chomp question
in thread chomp question

Perhaps this will do what you want to do?
use strict; use warnings; while (my $line = <DATA>) { if ($line =~ /CLI/) { chomp $line; while (my $line2 = <DATA>) { next unless $line2 =~ /\S/; # ignore blank lines $line .= " $line2"; last; } } print $line; } __END__ MVC DOWO(8),WCPA CLI WCPA+2,C'.' BNE UPCC22
which prints
bash-3.2$ perl suno.pl MVC DOWO(8),WCPA CLI WCPA+2,C'.' BNE UPCC22 bash-3.2$