#!/usr/bin/perl

=head1 NAME

gen_purple.pl - Generates a skeleton XML file conforming to purple.dtd.

=head1 SYNOPSIS

Usage:
  gen_purple.pl

=head1 DESCRIPTION

Generates a skeleton XML file conforming to purple.dtd with the
author's name and e-mail address, and the current date.

=cut

my $AUTHOR_NAME = 'Eugene Eric Kim';
my $AUTHOR_EMAIL = 'eekim@eekim.com';
my $DATE = &date;

print <<EOM;
<?xml version="1.0"?>
<!DOCTYPE purple PUBLIC "-//Eugene Eric Kim//DTD Purple v0.3//EN"
    "http://www.eekim.com/dtds/purple.dtd">
<?xml-stylesheet type="text/xsl" href="purpletohtml.xsl"?>
<purple>
  <docinfo>
    <title></title>
    <author>
      <name>$AUTHOR_NAME</name>
      <email>$AUTHOR_EMAIL</email>
    </author>
    <datecreated>$DATE</datecreated>
    <datepublished></datepublished>
    <version>1.0</version>
    <lastnid></lastnid>
  </docinfo>

<section>
<h></h>

</section>

</purple>
EOM

# fini

### subroutines

sub date {
  my @date = localtime;
  my @months = ('January','February','March','April','May','June','July',
                'August','September','October','November','December');
  return $months[$date[4]] . ' ' . $date[3] . ', ' . ($date[5] + 1900);
}

=head1 AUTHOR

Eugene Eric Kim <eekim@eekim.com>

=cut
