in reply to Anonymous hash with array
In general, I think it's easier to use a reference to an anonymous hash in complicated data structures like these.
Depending on your data, you might be able to get away with two ifs instead of the if/elsif block.
Also, you didn't close the elsif pattern match.
might work for you.my $frq_node = {}; while (<FH>){ $frq_node->{$key}[0]{$to}++ if /sending ping/; $frq_node->{$key}[1]++ if /recevied ping response/; }
|
|---|