in reply to Re^4: data persistence
in thread data persistence
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 $filename = join('', split('\.', $ENV{REMOTE_ADDR}) ); ... # then, somewhere write to / read from the file
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);
|
|---|