Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Mobious Monks,
Simple style question. I have a count variable that is to be set depending on a condition: Wherein '$some_variable' can have the values 'x' and 'y' only. Coding the actual values right there in the conditonal effectively buries that way down in the bowels of a long program, but uses the minimum lines of code and is highly readbable once you find that snippet. Setting two value holders at the top of the script make for easier maintenance when the values need to be changed some day: but it creates double referencing and extra lines of code. A third way would be to declare a hash: Any feelings on which is preferable from a coding style and/or efficiency point of view? Forget that fear of gravity, In reply to Style: buried variables or double referencing? by punch_card_don
|
|