I have a HoHoH structure that looks like after running print Dumper (\%hash);
   
            'prlhNSSA' => {
                          '1499' => {
                                      'gecos' => 'First Name Last 
Name,CIS,location,
                                      'host' => '/var/tmp/passwd.tgpdrpp1.hpux',
                                      'gid' => '205'
                                    }
                        }
        };

   
  My 1st hash is keyed by name, that accesses 2nd hash keyed by UID,  that 
accesses a 3rd hash keyed by remaining items: gid,gecos and hostname.
   
   The snippet of code is: 
   
  my %hash;
  my ($name, $uid, $gid, $gecos);
  my $regexp    = qr/(\w+|\w+\.\w+|\w+\-\w+|\w+\_\w+)\s+(\d+)\s+(\d+)\s+(.*)/i ;
  ...
  ...
  elsif (/$regexp/) {
          ($name, $uid, $gid, $gecos) = ($1, $2, $3, $4);
            $hash{$name}{$uid} = { # User data keyed by uid
                    gid     => $gid,
                    gecos => $gecos,
                    host    => $host,

  my question is how do I access and print all values? I am trying:
   
  foreach  (keys %dub_hash) {
    print %{$dub_hash->{$name}->{$uid}->{%gid}->{$gecos} };
}

  Do I need three loops? What am I doing wrong?
   
  thank you
  
 
   
   

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to