in reply to How can I print all lines instead of 1 random?
rand($.) < 1 && ($line = $_) while <FILE>;
You could easilly change this to loop over the file, doing something with each line along the way:
while (<FILE>) { my $line = $_; chomp($line); # note, 'chomp' is a safer version of 'chop': see +perldoc -f chomp; # do something with $line... }
Hope this helps.
-Blake
|
|---|