in reply to Re: Re: hash referencing...best approach?
in thread hash referencing...best approach?
If you have a relatively small number of departments (keys %departments), you can keep all the output files open for writing. Otherwise, you'll need to open for append each time you want to write a line of output. (You could also hold some number of lines in memory and write them out every so often, for a little less open and closing action.)my %session_hash; my %departments; # for each of the 6 session files, # open and read line-by-line # parse out user_id, session_id, dept_code $session_hash{$session_id} = $dept_code; $departments{$dept_code}++; # # for each apache log # open and read line-by-line # parse out session_id # append the line to the file associated with $session_hash{$s +ession_id}
HTH.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^3: hash referencing...best approach?
by Anonymous Monk on Nov 25, 2003 at 00:06 UTC | |
by Roy Johnson (Monsignor) on Nov 25, 2003 at 02:51 UTC | |
by Roger (Parson) on Nov 25, 2003 at 00:25 UTC |