#!/usr/local/bin/perl

use CGI;                             

$co = new CGI;                        

print $co->header,                    

$co->start_html(
    -title=>'CGI Example', 
    -author=>'Steve', 
    -meta=>{'keywords'=>'CGI Perl'}, 
    -BGCOLOR=>'white', 
    -LINK=>'red'
);

if ($co->param()) {
    $! = 0;

    open FILEHANDLE, ">>reg.log";

    print FILEHANDLE "Date: " . `date`;
    print FILEHANDLE "Name: " . $co->param('name') . "\n";
    print FILEHANDLE "email: " . $co->param('email') . "\n";

    close FILEHANDLE;

    unless ($!) {
        print "Thanks for registering.";
    } else {
        print "Sorry, there was an error: $!";
    }
}

    print $co->end_html;                  
