Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Compare two hash values for a match

by hdb (Monsignor)
on Oct 13, 2013 at 09:52 UTC ( #1058050=note: print w/replies, xml ) Need Help??


in reply to Compare two hash values for a match

It seems much easier to me to set up your lookup like this

$lookup{$sysoid} = $name;
instead of
$lookup{$name}{"name"}=$name; $lookup{$name}{"sysoid"}=$sysoid;
because that is how you want to use it.

Replies are listed 'Best First'.
Re^2: Compare two hash values for a match
by vlad3848 (Acolyte) on Oct 25, 2013 at 07:05 UTC
    Thank you! I actually reversed it and made my sysoid as the key value. It made it easier to compare keys later
    if (defined $name and defined $sysoid){ $lookup{$sysoid}{name} = $name; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1058050]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2018-07-23 15:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (471 votes). Check out past polls.

    Notices?