Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

by perlmonkey (Hermit)
on Sep 25, 2003 at 23:31 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://294293]
[choroba]: :-) sweet? The main ingredients are vinegar and onion

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-11-21 11:13 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (297 votes). Check out past polls.