Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 15 lines (12 sloc) 0.324 kB
#!/usr/bin/perl -w
use strict;
use vars qw(@lines $i $temp $pick);
# shuffle a file (sucks file into RAM!)
@lines = <>;
for ($i = 0; $i < scalar(@lines) - 1; $i++) {
$pick = int(rand(scalar(@lines) - $i)) + $i;
$temp = $lines[$i];
$lines[$i] = $lines[$pick];
$lines[$pick] = $temp;
print $lines[$i];
}
Jump to Line
Something went wrong with that request. Please try again.