Help for this page
$ sample 10 somelongfile.txt ## to get 10 random lines $ some long command | sample 50 > mysample.txt
my $wanted = shift || 10; my @got; ... die "Not enough lines!\n" if @got < $wanted; print @got;