#! /usr/local/bin/perl ################################# # # # WeddingPlanner CGI # # # # Written by Zach Whalen -- # # (zwhalen@english.ufl.edu)# # # Please contact me if you use this # program or if you have any questions. # # # Copyleft Zach Whalen 2003 # # You can use this program if # # you want to. Just don't try to# # Copyright it yourself, please.# # # ################################# ### SUMMARY ### # # This is part of a script which helps you # keep up with addresses and other related # information when you're planning a wedding # (or conference). # alarm(30); use strict; print "Content-type: text/html \n\n"; my @datfiles = glob "*.dat"; my @Sorted = sort (@datfiles); print <

These can be printed as mailing labels, maybe.

Back to the main data screen.


START_OF_HTML foreach (@Sorted){ my %hash = &make_hash($_); my $file = $hash{surname}.".dat"; print <

$hash{firstname} $hash{surname}
$hash{address1}$hash{address2}
$hash{city}, $hash{state} $hash{zip}

MIDDLE_OF_HTML } print < END_OF_HTML sub make_hash { my ($key, $val, %hash); my $filename = $_[0]; open READ, "$filename" or return 0; my @file = ; close READ; foreach (@file){ chomp $_; ($key, $val) = split /=/,$_; $hash {$key}=$val; } return %hash; }