The Perl cookbook that we all know is often a great source of take-away code to inject here and there in an incomplete script or module.
However when I read entry 8.7 Randomizing All Lines (in files) that says the solution is to slurp the entire file into an array, shuffle it (using their excellent shuffling sub), and write it out, I couldn't help *coughing*... I've got a ~3Go file the lines of which I need to shuffle, and somehow I was hoping for a more realistic solution
Oh well, it still is a great book. I eventually found my own (non-generic solution, I didn't go the seek()ing way) by using the fact that each line had a date and shuffling the dates and hours, then shuffling the lines accordingly in several passes.
I couldn't find a generic line shuffling module on CPAN, so if anyone out there knows of one or feels like writing one then please let me know ! The best would be one that would call a callback before writing each shuffled line out so that it can be modified (I'm falsifying lost httpd logs...)