http://www.perlmonks.org?node_id=154854


in reply to Re: Estimating Vocabulary
in thread Estimating Vocabulary

my(@lines, $line); open(FILE, shift) || die; 1 while <FILE>; $line=$.; seek(FILE, 0, $. = 0); rand($line-$.) < $ARGV[0]-@lines && push(@lines,$_) while <FILE>; print @lines, "wc -l could have told you this is $. words\n";