in reply to Re: While Loops
in thread While Loops
With the improved spec, you'd want something more like:
#!/usr/bin/perl -w use strict; my @data=(); my $file='c:\text.txt'; open my $fh,"<", $file or die "$file: $!"; while (my $line = <$fh>){ push @data, $line; if (@data == 100) { print @data; @data = (); } } print @data;
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
---|
In Section
Seekers of Perl Wisdom