Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

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


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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-18 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found