in reply to How can I print all lines instead of 1 random?

I don't quite see how the @part array is dealt with when you are looking at the entire file. However, the code that picks a random line is:

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