James has asked for the wisdom of the Perl Monks concerning the following question:
dbmopen (%hitsdb,$db,0755) || print "can't dbmopen hitsb: $!"; if ($hitsdb{$page}) { $key = "$Year$Month$hour$referer"; print $key; if ($hitsdb{$page}->{$key}) { $hitsdb{$page}->{$key}->{'counter'}++; print "increment instance"; } else { %hitsdb = ( $page => { $key => { 'year' => $Year, 'month' => $Month, 'day' => $month_day, 'referer' => $referer, 'counter' => 1 } } ); print "new instance"; } } else { $key = "$Year$Month$hour$referer"; print $key; %hitsdb = ( $page => { $key => { 'year' => $Year, 'month' => $Month, 'day' => $month_day, 'referer' => $referer, 'counter' => 1 } } ); print "new instance and page"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash of Hashes of Hashes
by RMGir (Prior) on Aug 16, 2002 at 11:55 UTC | |
|
Re: Hash of Hashes of Hashes
by Abigail-II (Bishop) on Aug 16, 2002 at 12:11 UTC | |
|
Re: Hash of Hashes of Hashes
by ehdonhon (Curate) on Aug 16, 2002 at 12:48 UTC | |
by Anonymous Monk on Aug 17, 2002 at 11:04 UTC | |
|
Re: Hash of Hashes of Hashes
by RMGir (Prior) on Aug 16, 2002 at 15:15 UTC | |
|
Re: Hash of Hashes of Hashes
by Anonymous Monk on Aug 16, 2002 at 13:22 UTC | |
|
Re: Hash of Hashes of Hashes
by James (Initiate) on Aug 16, 2002 at 14:52 UTC | |
|
Re: Hash of Hashes of Hashes
by James (Initiate) on Aug 16, 2002 at 15:52 UTC |