in reply to Anonymous hash with array

You don't need the extra {}s around frq_node in the if block... $frq_node{$key}[0]{$to}++ should work.

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.

my $frq_node = {}; while (<FH>){ $frq_node->{$key}[0]{$to}++ if /sending ping/; $frq_node->{$key}[1]++ if /recevied ping response/; }
might work for you.