- or download this
open my $fh, '<', $file or die "$file : $!";
my $p = int( 1 + rand -s $fh );
seek $fh, $p - $GLEN, 0;
chomp( my $pick = <$fh> );
chomp( $pick = <$fh> ) while tell( $fh ) < $p;
- or download this
#! perl -slw
use strict;
...
}
print "$_ : $stats{ $_ }" for sort keys %stats;
- or download this
P:\test>414916 -GLEN=10 -TRIES=100000 junk
line 1 : 9964
...
line 8 : 9991
line 9 : 9806
- or download this
P:\test>414916 -GLEN=7 -TRIES=100000 junk
ine 1 : 1239
...
line 8 : 8581
line 9 : 8683
ne 10 : 1246