view html/names.pl @ 90:aa91f3f3437c

better template
author rlm <rlm@aurellem.org>
date Thu, 14 Jan 2016 12:21:26 -0800
parents d469c90e2002
children
line wrap: on
line source
1 #!/usr/bin/perl
3 use Tie::File;
6 tie @last, 'Tie::File', "./dist.all.last" or die;
8 tie @first, 'Tie::File', "/home/r/proj/aurellem/html/dist.all.first" or die;
10 $num_first = 5494;
11 $num_last = 88799;
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";
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 }
26 &print_rand_name();
27 &print_rand_name();
28 &print_rand_name();
29 &print_rand_name();
30 &print_rand_name();