Ryan wrote:

Gunnar Hjalmarsson wrote:

One way to do that is to store the sentences in an output array instead of printing them directly.

Within the while loop:

    push @output, ...;

And then:

    chomp @output;
    print "@output\n";

This approach did the job.  Thanks.

A more efficient method is to read and write one line at a time:

$\ = ' ';  # set Output Record Separator to a space
while ( <> ) {
    $\ = "\n" if eof;
    chomp;
    print;
    }



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

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


Reply via email to