Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
Think about Loose Coupling
 
PerlMonks  

Re: Reset while loop to beginning of hash when using 'each'

by perlmonkey (Hermit)
on Sep 25, 2003 at 19:31 UTC ( [id://294293]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Reset while loop to beginning of hash when using 'each'

according to the each perldoc page, you have to reset the each call or else it will always keep iterating from where you left off.

To reset the is says execute: keys %hash; so you need something like:
# reset each keys %{$self->{'residues'}{$modelCount}}; while( my ($res, $ats) = each %{$self->{'residues'}{$modelCount}} ) { if($ats eq $line){ do stuff to $line; last LINE; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://294293]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.