John W. Krahn wrote:
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;
    }

That may be an efficient solution to some other problem but the one the OP initially presented. ;-)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

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


Reply via email to