e***@mindspring.com
2006-01-30 21:04:15 UTC
OK, so I see that this is a Perl 5.8 change. I am getting this
"Pseudo-hashes are deprecated" error while following the Camel Book v3
and trying to generate a count of items in a hash of hashes thus:
scalar(keys %{ $logips{$key} } )
Basically I'm parsing a Web log file and am trying to keep a list of
unique IPs that visited each page (modifying Perl Cookbook recipe 4.6)
thus:
my %logips=();
my %logipseen=();
foreach $snifferlog (@ARGV) {
blah blah blah;
push (@{ $logips{$logfile} }, $logip) unless (
$logipseen{ $logfile }{ $logip } )++;
}
foreach $key (@logfiles) {
print scalar(keys %{ $logips{$key} } );
So $logips{$key} should have a hash of all the unique IPs in it, I just
want a quick count, but I'm having trouble with the hash of hash
syntax. Apparently the older syntax in the camel book's not good any
more and I've fiddled aroudn with this a while and read Web tutorials
on hashes of hashes without luck. Any help welcome!
Thanks,
Ernest
"Pseudo-hashes are deprecated" error while following the Camel Book v3
and trying to generate a count of items in a hash of hashes thus:
scalar(keys %{ $logips{$key} } )
Basically I'm parsing a Web log file and am trying to keep a list of
unique IPs that visited each page (modifying Perl Cookbook recipe 4.6)
thus:
my %logips=();
my %logipseen=();
foreach $snifferlog (@ARGV) {
blah blah blah;
push (@{ $logips{$logfile} }, $logip) unless (
$logipseen{ $logfile }{ $logip } )++;
}
foreach $key (@logfiles) {
print scalar(keys %{ $logips{$key} } );
So $logips{$key} should have a hash of all the unique IPs in it, I just
want a quick count, but I'm having trouble with the hash of hash
syntax. Apparently the older syntax in the camel book's not good any
more and I've fiddled aroudn with this a while and read Web tutorials
on hashes of hashes without luck. Any help welcome!
Thanks,
Ernest