Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: To Hash or Not to Hash??

by Roy Johnson (Monsignor)
on Dec 02, 2003 at 19:28 UTC ( [id://311717]=note: print w/replies, xml ) Need Help??


in reply to To Hash or Not to Hash??

First of all, this is not real code. Your hash assignments lack an equals sign, the closing parenthesis on %theirs is an open parenthesis, and you're quoting the side of the hash assignment arrows that doesn't need quotes.
68.168.192.17 => 'ns1.a'
not
'68.168.192.17' => ns1.a
Your if block is not sensible. It seems that $_ should figure in the conditional somehow; isn't that what you want to test? Maybe something like:
if ($ours{$_} eq 'ns1.t') { print OUT "$_\n"; } elsif ($theirs{$_} eq 'ns1.a') { print OUT1 "$_\n"; }
You mention a sort in your question, but not in your code. Could you give us a little clearer description of what you want your code to do?

The PerlMonk tr/// Advocate

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://311717]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (1)
As of 2024-04-25 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found