Before this page
See the advice for a novice first where you make compulsory changes on the first line (path) and the basic set up for password, url, etc. and, if necessary, "chdir" command to change the directory at the button of the basic set up. You may make any optional changes but please do so after you confirm that the default CGI works.

Simple optional changes
You may make optional changes
################
# basic set up #
################
     :
     :
$max = 512;
$wait = 3;
$lexp = 15;
where
$max = 512;
sets the maximum length of article to be put on the mother board. An article longer than this is cut to fit the mother board. To the full article, a separate daughter board is created and a link is made from the mother board.
$wait = 3;
sets how long a guest sees "Thank you" message after he sends comments. The default is 3 seconds.
$lexp = 15;
sets the period of time the validity of a lock file expires. (Suppose two guests post messages almost at the same time, they would crash over the data file and corrupt it. A lock file or temp.dat marks the cgi already has a message to handle. This is not a perfect solution, but this is widely used to control data traffic. The trouble is this file may be left after an error, blocking all data thereafter. The cgi checks temp.dat and removes it after $lexp which initial value is 15 minutes.) This lock is also used during your administrative work. So have it just long enough for your maintenance work.

Others in "basic set up" set few wording.
$dname = "Guest";
$dttle = "Hello";
$dcmmt = "I just want to say hello.";
set the name of the guest, the title and comments if they are not filled by a guest.
$chck = "delete / archive checked";
$aok = "All OK";
$aall = "Archive all";
$dall = "Delete all";
set the words in the submit buttons of the board master's administrative page. So they are just for you.

$erro0 to $erro5 set error messages when something went wrong. As far as you do not write something misleading, you can change them safely.

HTMLs
You can find and modify many HTMLs hidden in cgi. You may import them to homepage authoring soft, change them, open the page sources and copy and paste them back to cgi.

What start with $ such as $cgi are Perl variables. Do not change their spellings. If you want to change them, study perl first, otherwise the message board malfunctions. If you want to have a dollar mark inside perl, spell it \$ instead of $. (Price: $50 must be Price: \$50.) Also if you want to have @, write it \@. (So, your@mail.address must be your\@mail.address. Else perl returns an error.) And if you want \, it must be \\ instead.

First, how the message board itself looks
##########
# to bbs #
##########
     :
     :
<HTML>
<HEAD>
<TITLE>DoubleMessageBoard</TITLE>
</HEAD>
<BODY BGCOLOR="lightgreen">
<CENTER><H1>DoubleMessageBoard</H1></CENTER>
<FORM ACTION="$cgi" method="POST">
<TABLE>
<TD ALIGN=right>
Your Name:<BR>Email Address:
</TD>
<TD ALIGN=left>
<INPUT TYPE="text" NAME="name" SIZE=30><BR>
<INPUT TYPE="text" NAME="email" SIZE=30>
</TD>
</TABLE>
Title: <INPUT TYPE="text" NAME="title" SIZE=40>
<P>
Comments: (If no message is sent, standard greeting is automatically registered.)<BR>
<TEXTAREA NAME="comments" cols=80 rows=10 wrap="virtual"></TEXTAREA>
<P>
<INPUT TYPE=submit VALUE="OK/send">
<INPUT TYPE=reset VALUE="reset">
</FORM>
You can relocate INPUT fields and TEXTAREA as far as they are placed between <FORM> and </FORM>. But do not delete them. Do not change their NAMEs.

Second, how the posted article is arranged
######################
# new message to bbs #
######################
     :
     :
### new data ###
     :
<hr>
<b>$gname</b> <small>($posted)</small>
<p><b>$data{'title'}</b>
<p>$data{'comments'}
$gname is the name of the guest, such as Tom. If the guest has an email address, $gname contains it too, such as <a href="mailto:Tom's@mail.address">Tom</a>. You can use $data{'name'} for the guest name and $data{'email'} for his mail address so that you can show them separately. $posted is the time the article is posted. $data{'title'} is the title of the article and $data{'comments'} is the main body of the article.

You do not change the spelling of these variables. And they must be placed between $msg = <<"NEW_DATA"; and NEW_DATA. Of course, you respect HTML grammar if you want to make changes.

Third, how a daughterboard looks
#######################
# daughterboard entry #
#######################
     :
     :
<HTML>
<HEAD>
<TITLE>DaughterBoard</TITLE>
</HEAD>
<BODY BGCOLOR="lightpink">
<B>$data{'title'}</B>
<P>
$data{'comments'}
</BODY>
</HTML>
DoubleMessageBoard puts the full text onto a daughterboard if it is too long. And this is how it is arranged. Just like a short text on the mainboard (as explained above), you can use $gname, $data{'name'}, $data{'email'}, $posted, $data{'title'} and $data{'comments'}.

Further, they must be placed between print DFL <<"HTML_DAUG"; and HTML_DAUG. And you respect HTML grammar if you want to modify the daughterboard.

And when a daughterboard is made, a link from motherboard is made to the daughterboard. This link can be also changed.
#######################
# daughterboard entry #
#######################
     :
     :
### link to daughterboard ###
$data{'comments'} .= "<p><a href='$time.html'><i>$cutoff more byte(s), click here!</i></a>";
You can modify only <i>$cutoff more byte(s), click here!</i> here. $cutoff is the size of comments above the text on the motherboard. As double quotation marks are used to mark the beginning and end of the link, you can not use " inside this perl expression. Use a single quotation mark ' or use \" for a double quotation mark if you need to quote something.

Next, "thank you" message
#####################
# thank you message #
#####################
     :
     :
<HTML>
<HEAD>
<TITLE>Thank you :-)</TITLE>
</HEAD>
<BODY>
<BR><H1>
Dear $data{'name'},
</H1><H2>
Your comments have been successfully added.<BR>
Now, you will be back to the MessageBoard.
</H2>
</BODY>
</HTML>
A guest sees this message after posting comments.

The last, an archive page
##################
# edit data file #
##################
     :
     :
### archive page ###
     :
     :
<HTML>
<HEAD>
<TITLE>Archives</TITLE>
</HEAD>
<BODY BGCOLOR="lightgreen">
<CENTER><H1>DoubleMessageBoard Archives</H1></CENTER>
<A HREF="$html"><B>back to the message board top page.</B></A>
The archive page starts like this. $html is the full url of your messageboard itself. You can change the page top as you like.

And when an archive page is made, a link from motherboard is made to the archive page. This link can be also changed.
##################
# edit data file #
##################
     :
     :
### link to archives ###
print LOCK "<!--arch-->\t<HR><A HREF='$arch'><B>... more articles, click here!</B></A>\n";
You can modify only <B>... more articles, click here!</B> here. Again, double quotation marks are used to mark the beginning and end of the link, use a single quotation mark ' or \" for a double quotation mark inside the Perl expression.

Yet still more, an addition, an error page
#####################
# Error No1 message #
#####################
     :
     :
<HTML>
<HEAD>
<TITLE>Error!</TITLE>
</HEAD>
<BODY>
<P><B>Administrative Notice,</B><P>
Your command has been averted:
<BR>$_[0]
<BR>$_[1]
<BR>$_[2]
<BR>$_[3]
</BODY>
</HTML>
Go far below the script. This page greets your guest when something went wrong. Do not change $_[0] to $_[3] unless you understand them. They are standard error messages defined in the basic setting at the very top and $!, the perl's own error message and the line number where error takes place.


You find other HTMLs for administrative pages. But they are for you, the webmaster. Though you can change them if you like.

How the login page looks
################
# starts login #
################
     :
     :
<HTML>
<HEAD>
<TITLE>Webmaster Only!</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>This is the webmaster's administrative page.</H1>
<H2>If you are here by mistake,
<BR>DoubleMessageBoard is Here.</H2>
<H1><A HREF="$html">PLEASE ENTER</A></H1>
<BR>If you are here to hack the site, please don't.
<P>
<FORM ACTION="$cgi" method="POST">
<INPUT TYPE="hidden" NAME="from" VALUE="login">
Password: <INPUT TYPE="password" NAME="pswd"><BR>
<INPUT TYPE="submit" NAME="submit" VALUE="OK / Login">
<INPUT TYPE="reset" VALUE="reset">
</FORM>
</CENTER>
</BODY>
</HTML>
Do not change the INPUT fields hidden and password. And they must be between <FORM> and </FORM>.

The page from which you edit the board
##############
# admin page #
##############
     :
     :
### editor page head ###
     :
     :
<HTML>
<HEAD>
<TITLE>Webmaster Only!</TITLE>
</HEAD>
<BODY>
<CENTER><H1>DoubleMessageBoard</H1></CENTER>
<B>Welcome to the webmaster's tool!</B>
<FORM ACTION="$cgi" method="POST">
     :
     :
<P>
$dataf
<P>
<INPUT TYPE="radio" NAME="$i" VALUE="X" checked> keep it on board<BR>
<INPUT TYPE="radio" NAME="$i" VALUE="D"> DELETE<BR>
<INPUT TYPE="radio" NAME="$i" VALUE="A"> move to Archive
     :
     :
<HR>
<INPUT TYPE="hidden" NAME="pswd" VALUE="$pswd">
<INPUT TYPE="hidden" NAME="from" VALUE="edit">
<INPUT TYPE="submit" NAME="submit" VALUE="$chck">
<INPUT TYPE="reset" VALUE="reset">
<INPUT TYPE="submit" NAME="submit" VALUE="$aok">
<INPUT TYPE="submit" NAME="submit" VALUE="$aall">
<INPUT TYPE="submit" NAME="submit" VALUE="$dall">
The upper block is the editor page head. You can change it as you like except the last line <FORM ACTION="$cgi" method="POST">.

The middle block is for each article. You can change words keep it on board, DELETE and move to Archive but do not change others.

You do not want to change anything in the lower block except <HR> at the beginning.