{846} revision 0 modified: 10-31-2010 13:57 gmt |
Shuffle lines read in from stdin. I keep this script in /usr/local/bin on my systems, mostly for doing things like ls | shuffle > pls.txt && mplayer -playlist pls.txt #!/usr/bin/perl -w use List::Util 'shuffle'; while (<STDIN>) { push(@lines, $_); } @reordered = shuffle(@lines); foreach (@reordered) { print $_; } |