which printsuse 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
bash-3.2$ perl suno.pl MVC DOWO(8),WCPA CLI WCPA+2,C'.' BNE UPCC22 bash-3.2$
In reply to Re^4: chomp question
by ramlight
in thread chomp question
by suno
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |