Hello, I hope someone can help me. I am attempting to modify a perl
script that uses hashes and my problem is that I am trying to add hashes
values to the array $o_traffic_rec but I can't seem to reference the
value of the new hash. 

The array is defined as $o_traffic_rec{hosts}{$var1}

I am trying to add a hash to this array called
$o_traffic_rec{source}{$var2}

In the code listing below the hash 'hosts' value is referenced using
$key. So the variable $key is going to give me one value but how would I
reference the value for my new hash 'source' within this loop.

foreach $key (reverse sort
             { $o_traffic_rec{hosts}{$a} <=> $o_traffic_rec{hosts}{$b} }
keys %{ $o_traffic{to} })  {
                # don't print records under the threshold
                next if ($o_traffic_rec{hosts}{$key} < $THRESHOLD);

                print "<tr>";
                if (my $h = gethost($key))  {
                        my $name = $h->name;

                        print some stuff here -----
                } else  {
                       print some other stuff here -----
                }

Todd Kennedy
Unix Administrator / System Automation Engineer
E-Sync Networks, Inc.
(203)601-3363
[EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to