in reply to tracking unique users in a weblog
Is seek and tell significantly faster than simply walking through the file with a while loop until I get to where I need to be?Uhm, yes. For the same reason that it's faster to do:
than to do:my $element = $array [$big_num];
With a seek, you do a simple operation once. With a line-by-line scan, you do a complex operation many, many times.my ($element) = grep {$_ == $big_num} 0 .. $#array;
Personally, I'd have the webserver log to a database.
Abigail
|
|---|