in reply to Re^4: Undefined Error
in thread Undefined Error
In your dataset, there is no one with more than 3 searches. If you do not like the other output, remove the print statements. If you want to check for the total number of searches, you need to sum up across connections like this:
for my $user (keys %users) { my $totalsearches=0; for my $conn (@{$users{$user}}) { if( exists $searches{$conn} ) { print "User $user had ".scalar( @{$searches{$conn}} )." searches + on connection $conn\n"; $totalsearches += @{$searches{$conn}}; } } print "User $user had $totalsearches searches in total\n"; print "\t=> Bad user!\n" if $totalsearches > 3; }
|
|---|