You can't my a single hash element. Declare the entire hash once, outside the loop. Move the declaration for $smtp_inc_tot outside the loop as well. Something like this:
For more information, you may want to check out Coping with Scoping by our own Dominus.my (%smtp_inc_src_cnt, %smtp_inc_dst_cnt, $stmp_inc_tot); if ($if_name eq $outside_if && $if_dir eq 'inbound') { if (my $service eq 'mail') { $smtp_inc_src_cnt{$src} ++; $smtp_inc_dst_cnt{$dst} ++; $smtp_inc_tot ++; } }
HTH
In reply to Re: Autoincrement errors...
by VSarkiss
in thread Autoincrement errors...
by k2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |