develooper Front page | perl.beginners | Postings from March 2002

Matching key values from more than one hash

From:
J.Hourihane
Date:
March 13, 2002 07:26
Subject:
Matching key values from more than one hash
Message ID:
9877566273EED511A7560008C716DA06B3DE@exchcpn1.cdcna.com
--aplogies forgot Subject line

Hi guys I am having trouble trying to figure out how to do a match between
two hashes
basically I have the $login and $gid from the passwd file and the $gid and
$gname fields from 
the group file. (I got these from getpwent and getgrent)


#!/util/perl5.static -w
# Build phash
%phash = ();
$gid => $login
@gid = keys( %phash );

# Build ghash
%ghash = ();
$gname => $gid

# Match $login to $group
foreach $gid (@gid) {

	if ($gid =~ / /;   ) {
		#Build $login => $gname Hash

	}


}



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About