#!/usr/local/bin/perl
$| = 1;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
$date = `/bin/date`;
$resume = "myres.html";
$logfile = "resume.log";
if(param("action") eq "showme")
{
$name = param("name");
$company = param("company");
$email = param("email");
$phone = param("phone");
if(!$name)
{
$status_text = "ERROR : Please enter a name.";
print header();
printQuery($status_text);
exit;
}
if(!$email || !($email =~ /\@/))
{
$status_text = "ERROR : Please enter a vaild email address.";
print header();
printQuery($status_text);
exit;
}
writelog($logfile, $name, $company, $email, $phone, $ENV{REMOTE_ADDR}, $date);
print header();
open(RESUME, "$resume") || die "Can't open $resume : $!\n";
while($line = )
{
print $line;
}
}
else
{
print header();
$status_text = "Hi there! I like to know who looks at my resume, so please provide small amount of infomation about yourself. Thank you for your interest.
** Please read *** Warning, due to the limited amount of time I have during the day, my resume is very much a \"work in progress\", please excuse the dust. ";
printQuery($status_text);
}
sub writelog
{
open(LOGFILE, ">>$logfile") || die "Can't open $logfile : $!\n";
print LOGFILE "$name:$company:$email:$phone:$ENV{REMOTE_ADDR}:$date";
close(LOGFILE);
}
sub printQuery
{
print <On to the Resume