File: abc.pl

package info (click to toggle)
mcl 1%3A14-137-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 10,704 kB
  • ctags: 5,125
  • sloc: ansic: 53,217; sh: 4,448; perl: 3,967; makefile: 422
file content (25 lines) | stat: -rwxr-xr-x 420 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/local/bin/perl -w

use strict;
my ($N, $k, $sd) = @ARGV;

$N = 100 unless defined($N);
$k = 1+int(($N/10)) unless defined $k;
$sd = $k-1 unless defined $sd;

my @w = map { chr($_) } (ord('a')..ord('z'), ord('A')..ord('Z'));


while ($N-- > 0) {
   my $d = $sd - int(rand(2*$sd));
   my $l = $k + $d;

   print $w[int(rand(@w))];
   while ($l-- > 0) {
      print "\t", $w[int(rand(@w))];
   }
   print "\n";
}