Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: trying to implement hash table. and getting lots of difficulties. plz help me out..........

by NetWallah (Abbot)
on Oct 10, 2012 at 16:53 UTC ( #998260=note: print w/replies, xml ) Need Help??


in reply to Re^2: trying to implement hash table. and getting lots of difficulties. plz help me out..........
in thread trying to implement hash table. and getting lots of difficulties. plz help me out..........

If you want to fail the search when the item is not found, you need to add the following line before the final "print"
die "$k was not found (slot $h)" unless grep {$k==$_} keys (%{$buckets +[$h][0]});
There are actually 3 keys in the "201" slot.
If you run the code I posted, it will show all three.
If you wanted to show only the matched key, you can use a grep statement , very similar to the one above.

             I hope life isn't a big joke, because I don't get it.
                   -SNL

  • Comment on Re^3: trying to implement hash table. and getting lots of difficulties. plz help me out..........
  • Download Code

Replies are listed 'Best First'.
Re^4: trying to implement hash table. and getting lots of difficulties. plz help me out..........
by Priti24 (Novice) on Oct 11, 2012 at 06:08 UTC
    thnk u very much.....

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998260]
help
Chatterbox?
[choroba]: I don't see it when XP doesn't change either
[marinersk]: That has always been its behavior, but I'm a visual/spacial- awareness guy. When the node disappears, it messes with my head, even though it is on the right margin.
[marinersk]: I was hoping there was a way to turn it on and make it stay on.
[LanX]: what is the intention of your question?

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2017-05-29 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?