"be consistent" | |
PerlMonks |
Re: Flag variablesby TomDLux (Vicar) |
on Mar 05, 2003 at 08:57 UTC ( [id://240558]=note: print w/replies, xml ) | Need Help?? |
Flag variables are often a warning of using the wrong program structure. On the other hand, I came across some convulted printing code :
It took some effort to reverse engineer the original specs, but I was able to simplify it to:
While things are spread out in the sense that things are detected and saved in flags in one spot, and used later, it avoids dealign with a highly nested conditional ( especially since some possible states were ignored. Of course, there are other solutions to the problem I encountered, but that's not relevant tothe topic of flag variables.
In Section
Seekers of Perl Wisdom
|
|