Skip to content

Instantly share code, notes, and snippets.

@hiroshi-manabe
Created April 15, 2019 16:45
Show Gist options
  • Save hiroshi-manabe/2f2ba6b414fc0dbde9eaa12e85b46d04 to your computer and use it in GitHub Desktop.
Save hiroshi-manabe/2f2ba6b414fc0dbde9eaa12e85b46d04 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -nl
use Getopt::Std;
BEGIN {
getopt("n:a:" => \%o);
$n = $o{"n"} ||= 10;
$all = $o{"a"};
}
if (rand($all - $. + 1) < $n) {
print;
--$n;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment