Mercurial > aurellem
comparison html/names.pl @ 27:d469c90e2002
fixed broken links.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 29 Apr 2012 08:58:47 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
26:91ede1e909b9 | 27:d469c90e2002 |
---|---|
1 #!/usr/bin/perl | |
2 | |
3 use Tie::File; | |
4 | |
5 | |
6 tie @last, 'Tie::File', "./dist.all.last" or die; | |
7 | |
8 tie @first, 'Tie::File', "/home/r/proj/aurellem/html/dist.all.first" or die; | |
9 | |
10 $num_first = 5494; | |
11 $num_last = 88799; | |
12 | |
13 print "Content-Type: text/plain", "\n\n"; | |
14 print "Random Name generator from US Census data.\n". | |
15 "Press refresh(F5) to generate more names.\n\n"; | |
16 | |
17 | |
18 | |
19 sub print_rand_name { | |
20 print $first[int(rand($num_first))]." ". | |
21 $first[int(rand($num_first))]." ". | |
22 $last[int(rand($num_last))]."\n"; | |
23 } | |
24 | |
25 | |
26 &print_rand_name(); | |
27 &print_rand_name(); | |
28 &print_rand_name(); | |
29 &print_rand_name(); | |
30 &print_rand_name(); | |
31 | |
32 | |
33 | |
34 | |
35 |