in reply to Flag variables
I would say it detracts from code clarity and locality (sp?): your someaction depends on some other piece of code (the conditional setting of $flag) which could be several lines away. If all you want to do is someaction, the $flag is totally superfluous - just do the action directly:
More learned minds than mine will undoubtedly come up with other reasons why flag variables are often "bad".foreach my $var (@somearray){ if($var eq "foo"){ someaction(); last;} }
CU
Robartes-
|
---|
In Section
Seekers of Perl Wisdom