Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: what would you like to see in perl5.12? (seek)

by tye (Sage)
on Aug 05, 2008 at 14:35 UTC ( [id://702374]=note: print w/replies, xml ) Need Help??


in reply to Re^2: what would you like to see in perl5.12? (trees)
in thread what would you like to see in perl5.12?

'seek' doesn't care whether the key exists or not. It just arranges for the next use of each (actually, adding a way to reverse 'each' would be prudent as well) finds the earliest key greater than or equal to the key given to 'seek'. For convenience of interface, 'seek' might return something which might be different depending on whether the requested key exists or not, but those are details best left to the (unknown) implementor.

- tye        

  • Comment on Re^3: what would you like to see in perl5.12? (seek)

Replies are listed 'Best First'.
Re^4: what would you like to see in perl5.12? (seek)
by Arunbear (Prior) on Aug 06, 2008 at 09:25 UTC
    But say you have a hash like
    %capital = ( France => 'Paris', England => 'London', Hungary => 'Budapest', );
    and you seek to 'Russia'. Should the next call to each behave as if all the elements had been read (i.e. return end-of-hash) ?

      Of course.

      - tye        

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found