[EMAIL PROTECTED] wrote:
Hi,

Hello,

I am trying to split a file (where there are one or more spaces) that
I am getting through a file handle that is fed into an array and then
printing each element of the array on a seperate line.

Here's what I have:  As you can probably figure out I only get each
element outputed
in a single line.

Any hints at how I can print out each element on a separate line would
be greatly appreciated.

Thanks in advance.


#!/usr/bin/perl -w
use strict;

open FILE, "test" or die "Can't open test ($!)";

while (<FILE>) {
     chomp;
     split /\s+/, @_;
     print "$_\n";
}

while ( <FILE> ) {
    print "$_\n" for split;
}



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