Your question is pretty specialised - it's not something I've ever done but hopefully I can offer a starting point.
From a quick look at the source of wwwboard.pl, it looks as if you could modify the following lines to insert some HTML of your own that called up a banner rotation script (or whatever advertising solution you're using):
[perl]
#####################
# New File Subroutine
sub new_file {
open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") ¦¦ die $!;
print NEWFILE "<html>\n";
print NEWFILE " <head>\n";
print NEWFILE " <title>$subject</title>\n";
print NEWFILE " </head>\n";
print NEWFILE " <body>\n";
# etc
[/perl]
Just find an appropriate place in the HTML that's being printed out, and insert:
[perl]
print NEWFILE "<your own HTML here>\n";
[/perl]
Hope this helps, let us know how you get on!