1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
my $max = 700;
my %seen = ();
my $run = 1;
while($run) {
my $lncount = 0;
while(<IN>) {
my $r = int(rand(2));
if($r == 0 and not exists $seen{$lncount}) {
print OUT $_;
$seen{$lncount} = 1;
--$max;
if($max == 0) {
$run = 0;
last;
}
}
++$lncount;
}
seek(IN, 0, 0) if $run;
}
ungetestet\n\n
<!--EDIT|esskar|1126513011-->