|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: Command line optionsby roboticus (Canon) |
| on Nov 01, 2011 at 20:03 UTC ( #935203=note: print w/ replies, xml ) | Need Help?? |
|
For the specific case you cited, you don't really need to know where the value comes from--you just want the "right" one to "win". I tend to do it by calculating the least interesting value first, then overwriting with the "better" values. In that way, I don't really care which value wins. I just know that the last (most important) one does. For example:
A few different usages gives:
This technique has its shortcomings, obviously, such as when (a) the computation is expensive or (b) has undesirable side effects. ...roboticus When your only tool is a hammer, all problems look like your thumb.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||