Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: While Loops

by kennethk (Abbot)
on Jan 08, 2013 at 18:58 UTC ( #1012312=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012312]
help
Chatterbox?
[ambrus]: sorry, typed in the wrong box
[LanX]: Your mother: je ne t'aime plus! ;)
[choroba]: seems lispy
[Your Mother]: Be nice! I speak that much French. Though I also like that song.
[choroba]: So, I joined Pod Černư Vrch some months ago to still have the fun. But I wouldn't call it "punk" anymore...
[LanX]: choroba deaf after one rehearsal per year ?
Discipulus .. per ear!
[LanX]: LOL
[choroba]: we used to play more :)
Discipulus played the guitar in a ska band 12 elemnts, very fun

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2017-03-24 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (301 votes). Check out past polls.