diff 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
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/html/names.pl	Sun Apr 29 08:58:47 2012 -0500
     1.3 @@ -0,0 +1,35 @@
     1.4 +#!/usr/bin/perl
     1.5 +
     1.6 +use Tie::File;
     1.7 +
     1.8 +
     1.9 +tie @last, 'Tie::File', "./dist.all.last" or die;
    1.10 +
    1.11 +tie @first, 'Tie::File', "/home/r/proj/aurellem/html/dist.all.first" or die;
    1.12 +
    1.13 +$num_first = 5494;
    1.14 +$num_last = 88799;
    1.15 +
    1.16 +print "Content-Type: text/plain", "\n\n";
    1.17 +print "Random Name generator from US Census data.\n".
    1.18 +      "Press refresh(F5) to generate more names.\n\n";
    1.19 +
    1.20 +
    1.21 +
    1.22 +sub print_rand_name {
    1.23 +  print  $first[int(rand($num_first))]." ".
    1.24 +    $first[int(rand($num_first))]." ".
    1.25 +    $last[int(rand($num_last))]."\n";
    1.26 +}
    1.27 +
    1.28 +
    1.29 +&print_rand_name();
    1.30 +&print_rand_name();
    1.31 +&print_rand_name();
    1.32 +&print_rand_name();
    1.33 +&print_rand_name();
    1.34 +
    1.35 +
    1.36 +
    1.37 +
    1.38 +