It looks to me like you're trying to dereference the wrong hash.

Try this...

sub COMMENTSYNC {
  my($rule,$data) = @_;
  my($crule,$temp,@map,$count);
  foreach my $item ( keys %{$data} ) {
    print ${$item}{'rule_desc'} . "\n";
  }
}

If the $data is a reference to a hash of hashes, then when the foreach
saves the key in $item, it is actually saving the inner hash in $item.
Then you just dereference $item as though it is a hash reference unto
itself.

On Fri, 2003-11-21 at 13:36, Eric Walker wrote:
> Hey all I know I have been told but I can't seem to access this hash.
> Can anyone look and see why I can't print out any values.  The print
> item statement works and prints out the first level of the hash.
> I send in a pointer to $data and $rule.
> 
> sub COMMENTSYNC{
> my($rule,$data) = @_;
> my($crule,$temp,@map,$count);
> foreach my $item (keys %{$$data}){
>          print  %{$$data{$item}{'rule_desc'}} . "\n";
>          #print $item . "\n";
>          }
> 
> Thanks
> 
> 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to