Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # main module #
- use Encode qw(encode decode);
- sub _m()
- {
- my $p ="..лехегезасебисоусесармаиндире.аератенбералаветиедоркуантеисриониуф";
- my $l = length($p);
- my $r = srand(time);
- sub name {
- my $ll = 4+rand(5); # 4-8
- my $n = '';
- while (length($n) < $ll) {
- $n .= substr($p, 2*int(rand($l/2)), 2);
- }
- $n =~ s/\.//g;
- $n=decode('cp1251',$n);
- $n=ucfirst lc $n;
- $n=encode('cp866',$n);
- return $n;
- }
- my $t = "\nГенератор названий планет\n\n";
- Encode::from_to($t, 'cp1251', 'cp866');
- printf($t);
- for my $n (1..18) {
- printf "%3d. %s\n", $n, name();
- }
- }
- ;1
- &_m;
Advertisement
Add Comment
Please, Sign In to add comment