Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 16 lines (14 sloc) 0.369 kb
#!/usr/bin/perl
my $bufsize = shift;
my $file = shift;
my @list = ();
srand();
open(FILE,"<$file") or die "Cannot open file $file\n";
while (<FILE>)
{
push(@list, $_), next if (@list < $bufsize);
print "##########\n",$_,"==========\n",rand($. / $bufsize), "\n\n";
$list[ rand(@list) ] = $_ if (rand($. / $bufsize) < 1);
}
close(FILE);
print foreach @list;
Jump to Line
Something went wrong with that request. Please try again.