#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
use HTTP::Response;
use HTTP::Cookies;
use LWP::Simple;
use LWP::UserAgent;
use Net::FTP;
use Fcntl qw/:flock :DEFAULT/;
BEGIN {
$ENV{PATH} = "/usr/bin:/bin:/usr/local/bin";
use CGI::Carp qw(carpout);
open(LOG, ">transloader-log.txt");
carpout(*LOG);
close(LOG);
}
$q = new CGI;
$tmpfile = $q->param('tmpfile');
# file name here where you come from
if ( $ENV{HTTP_REFERER} =~ 'zipper.cgi|search' || !param ) {
print <WebZip Transloader
EOL
print $query->endform();
print end_html();
my $counter = 'transloader-counter.txt';
sysopen(COUNT, $counter, O_RDWR|O_CREAT)
or die "Can't OPEN data file for READING and WRITING: $!";
flock(COUNT, LOCK_EX) or die "Cannot get
an EXCLUSIVE LOCK on data file: $!";
my $num = || 0;
chomp $num;
$num++;
seek(COUNT, 0, 0) or die "can't REWIND to
beginning of data file: $!";
truncate(COUNT, 0) or die "can't TRUNCATE data file: $!";
print COUNT "$num\n";
## Take out the line below if you don't
## want commas in your numbers.
1 while $num =~ s/(.*\d)(\d\d\d)/$1,$2/;
## Take out the next couple of lines
## down to "close COUNT...", if you
## don't want extensions on the end
## of numbers, such as st, nd, rd,
## or th... as in 2nd or 45th.
for($num){s/(1[123]|[4-90])$/$1th/ or s/1$/1st/ or s/2$/2nd/ or s/3$/3rd/};
close COUNT or warn $!;
print <You are the $num person to visit this page