John W. Krahn wrote:
> 
> This should do what you want:
> 
> 
> open FI, 'test.txt' or die "Could not open 'test.txt' $!";
> 
> my @lines;
> while ( <FI> ) {
>     s/\s+\z//;
>     if ( m!^\d\d/\d\d/\d{4}\|! ) {

Correction:

    if ( @lines && m!^\d\d/\d\d/\d{4}\|! ) {


>         print join( '|', splice @lines ), "\n";
>         }
>     push @lines, $_;
>     }
> print join( '|', @lines ), "\n";
> 
> close FI;


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to