#!/usr/bin/perl my @topics = qw(Welcome Photos Calendar FAQ Clothing Games Travel Discuss Contact_Us); my @build_topics = qw(FrimFram Tickets/ConfirmPurchase Tickets/CancelPurchase); sub write_file { my ($which) = @_; my $file = "$which/index.html"; close(STDOUT); open(STDOUT,">$file") || die("Couldn't write file [$file]\n"); } sub contents { my ($which) = @_; my $file = "$which/txt"; open(CON,"<$file") || die("Couldn't read file [$file]\n"); while () { print; } close(CON); } sub header { my ($which) = @_; # Create list o' topic links my $topics; foreach my $topic ( "SFLX", @topics ) { my $name = $topic; $name = "Calendar / Tickets" if $name eq "Calendar"; my $url = "/2001/$topic"; $url = "/" if $topic eq "SFLX"; # $url = "http://register.sflindyexchange.com" if ($topic eq "Registration"); $name =~ s/_/ /g; $topics .= ( ($topic eq $which) ? "$name

\n" : "$name

\n" ); } open(HEADER,") { s/\@TOPICS_GO_HERE/$topics/g; push(@hdr,$_); } close(HEADER); print @hdr; } sub footer { open(FOOTER,"; close FOOTER; } foreach my $topic ( @topics, @build_topics ) { print STDERR "$topic\n"; write_file($topic); header($topic); contents($topic); footer($topic); }