in reply to Perl Riddle
It might just be a personal problem, but most times I use each it ends up biting me. I've just settled into using a for loop, and it never caused me any problems related to resetting.
So instead of
while( my ($k, $v) = each(%ENGINES)){ push @eng, $v->{'name'}; }
... I would probably end up doing this:
for my $k (keys %ENGINES) { my $v = $ENGINES{$k}; push @eng, $v->{'name'}; }
This is a personal preference, and I'll admit that it does result in a little more code. I'm okay with that. I'd probably use map if I was concerned about brevity. The important thing is that I don't have to worry about resetting anything.
|
|---|