- or download this
while (<IN>){
while ($count<=$size){
...
$count++;
}
}
- or download this
while (<IN>){
rand($.)<1 && ($line=$_);
}
print OUT $line;
- or download this
my @lines = <IN>;
for my $c (1 .. 300) {
...
}
print OUT $line;
}
- or download this
my @lines = <IN>;
for my $c (1 .. 300) {
print OUT $lines[int rand @lines];
}
- or download this
use List::Util qw(shuffle);
my @lines = shuffle(<IN>);
print OUT @lines[0 .. 299];