#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use strict; use warnings; my ($etc, $pid); if ($ENV{'QUERY_STRING'} =~ /etc=(\d{6})/ ) { $etc = $1; if ( !defined($pid = fork()) ) { die "Unable to fork!"; } } else { die "Missing Email Tracking Code"; } our (%data, %file); our $dbh; our $user_number; use Template; use MIME::Lite; require "incl/common.pl"; require "incl/html.pl"; if ($pid != 0) { my $template = Template->new({INCLUDE_PATH => "$ENV{'DOCUMENT_ROOT'}/template"}); &html_head; my $vars = { 'command' => $data{'command'}, 'mail' => $data{'mail'}, }; $template->process('sendmail.tt', $vars); &html_foot; exit; } open my $fh, '>', "testfile.txt"; print $fh "MAIL - $data{'mail'}\n\n"; #.... # spend a long time sending email #....