Mercurial > aurellem
annotate html/names.pl @ 83:59349749269e
why didn't I have these before?
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 25 Oct 2015 11:26:37 -0700 |
parents | d469c90e2002 |
children |
rev | line source |
---|---|
rlm@27 | 1 #!/usr/bin/perl |
rlm@27 | 2 |
rlm@27 | 3 use Tie::File; |
rlm@27 | 4 |
rlm@27 | 5 |
rlm@27 | 6 tie @last, 'Tie::File', "./dist.all.last" or die; |
rlm@27 | 7 |
rlm@27 | 8 tie @first, 'Tie::File', "/home/r/proj/aurellem/html/dist.all.first" or die; |
rlm@27 | 9 |
rlm@27 | 10 $num_first = 5494; |
rlm@27 | 11 $num_last = 88799; |
rlm@27 | 12 |
rlm@27 | 13 print "Content-Type: text/plain", "\n\n"; |
rlm@27 | 14 print "Random Name generator from US Census data.\n". |
rlm@27 | 15 "Press refresh(F5) to generate more names.\n\n"; |
rlm@27 | 16 |
rlm@27 | 17 |
rlm@27 | 18 |
rlm@27 | 19 sub print_rand_name { |
rlm@27 | 20 print $first[int(rand($num_first))]." ". |
rlm@27 | 21 $first[int(rand($num_first))]." ". |
rlm@27 | 22 $last[int(rand($num_last))]."\n"; |
rlm@27 | 23 } |
rlm@27 | 24 |
rlm@27 | 25 |
rlm@27 | 26 &print_rand_name(); |
rlm@27 | 27 &print_rand_name(); |
rlm@27 | 28 &print_rand_name(); |
rlm@27 | 29 &print_rand_name(); |
rlm@27 | 30 &print_rand_name(); |
rlm@27 | 31 |
rlm@27 | 32 |
rlm@27 | 33 |
rlm@27 | 34 |
rlm@27 | 35 |