OK, so:
#!/usr/bin/perl
use diagnostics;
################
$db = '/home/www/web1027/html/service-partner/outbound-clicks.db';
$useflock='yes';
$flocklock='2';
$flockunlock='8';
####################
$url=$ENV{'QUERY_STRING'};
#### Form Variables ####
if ($url)
{
open(DATA,"$db");
@lines=<DATA>;
close(DATA);
open(DATA,">$db");
if ($useflock eq 'yes'){flock DATA, $flocklock;}
foreach $line (@lines)
{
($URL, $count) = split(/|/,$line);
if ($URL eq $url)
{
$count++;
print DATA ("$URL|$count\n");$old="yes";
}
else
{
print DATA $line;
}
}
if ($useflock eq 'yes'){flock DATA, $flockunlock;}
unless ($old)
{
print DATA "$url|1\n";
}
close(DATA);
print "Location: $url\n\n";
exit;
}
else
{
print "Content-type: text/html\n\n";
print <<EOM;
<center>
Nowhere To Redirect To!! <a href="http://www.billig-urlauber.de">Back To Billig-Urlauber.de</a>
EOM
exit;
}
EOF
aber geht trotzdem nicht :-(