There's more than one way to do things | |
PerlMonks |
Re^4: Is this code correctby GrandFather (Saint) |
on Mar 23, 2021 at 19:52 UTC ( [id://11130236]=note: print w/replies, xml ) | Need Help?? |
Try:
Using || in this context is simply wrong. If the user chooses black (some would say a valid choice) the user's choice is overridden, possibly generating a warning along the way. In this case warnings don't blatantly alert you to a key issue (|| instead of //), but they do give you a heads up to say that something needs attention. It is somewhat subtle, but the warning is telling you that the wrong operator is being used or inappropriate processing is taking place. Good warnings. Thank you warnings for helping me not shoot myself in the foot.
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
In Section
Seekers of Perl Wisdom
|
|