You are still using the same filename for all requests.
Instead of 'temp', give each request a file of their own.
my $filename = join('', split('\.', $ENV{REMOTE_ADDR}) );
...
# then, somewhere write to / read from the file
And because that may lead to a huge list of filenames, consider building a tree of directories based on the first numbers of the IP.
my @numbers = split('\.', $ENV{REMOTE_ADDR});
if( ! -d $numbers[0] ) {
mkdir($numbers[0]);
}
if( ! -d "$numbers[0]/$numbers[1]" ) {
mkdir("$numbers[0]/$numbers[1]");
}
my $path = "$numbers[0]/$numbers[1]";
my $filename = "$path/" . join('', @numbers);
|