-
Archives
-
Meta
Tag Archives: perl
Randomly sort the lines in a file
There are times when you need to randomly order the lines in a file. Here’s a script to do just that: #!/usr/bin/perl -w use strict; use List::Util 'shuffle'; my @lines = <>; print shuffle( @lines );