in reply to Scanning Log Files
The method you are using is probably taking up quite a lot of memory (depending on how large your log files are). You may think you are trading that memory for an algorithmic speedup, but remember that to split the file into an array requires looking at every byte for newlines. Try something like this and see if it fits your purpose:
my ($df, $dmysql); while (<>) { $df = $1 if /df_suu=(\d+)/; $dmysql = $1 if /d_mysql_suu=(\d+)/; } print "Last df_suu=$df\n"; print "Last d_mysql_suu=$dmysql\n";
|
|---|