In searching a flatfile database, can I stop a while loop when i find what I'm looking for? Does the "last" actually stop this loop?
while(<ACCOUNTS>) { my %account = split(/::/, $_); if( $account{"MASTER"} eq $_[0] ) { foreach my $key(keys(%account)) { #do something here } last; } }
Edited by Chady -- restored original contents and title.
In reply to Can a while loop be stopped with "last"? by stupidius
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |