vasu has asked for the wisdom of the Perl Monks concerning the following question:
Any ideas on where i'm going wrong with "${$frq_node{$key}[0]}{$to}++; " ?%frq_node = (); # Each hash entry will have a key corresponding to an interface # Each value is an array of 2 elements; element 0 is a hash # with each hash key being the timeout value of a ping send # and the value being the number of pings for that hash # value. element 1 is the number of received pings # open file code here while (<FH>) { if (/sending ping/) { # Extract interface key from line into $key # Extract the timeout value in sending ping $to # Increment the hash value of the corresponding # timeout bucket for the interface ${$frq_node{$key}[0]}{$to}++; # Does not work } elsif (/recevied ping response) { # Increment # of received pings for interface $frq_node{$key}[1]++; # Works fine! } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Anonymous hash with array
by kesterkester (Hermit) on Sep 19, 2003 at 16:42 UTC | |
|
Re: Anonymous hash with array
by simonm (Vicar) on Sep 19, 2003 at 16:46 UTC |