develooper Front page | perl.beginners | Postings from March 2002

reseting a while loop that uses each?

Thread Next
From:
Nikola Janceski
Date:
March 6, 2002 06:02
Subject:
reseting a while loop that uses each?
Message ID:
1449413DA482D311B67000508B5A12F50592DE2F@nyexchange01.summithq.com
foreach my $file (keys %NEW){
	$rev = (keys %{$NEW{$file}})[0];
	while (my ($cfile, $ids) = each %COOR){
		if( grep $NEW{$file}{$rev}[2] == $_, @{ $ids } ){
			$RELATION{$file} = $RELATION{$cfile};
			last;
			}
		}
	}

it seems that the 'while(each)' statement doesn't get reset when I do a
last;
it starts where it left off. How can I reset it?


Nikola Janceski

Anyone who has never made a mistake has never tried anything new.
-- Albert Einstein (1879-1955) 


----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About