I didn't mean that "just in perl" it's counter-intuitive, I meant, the way perl forces you to do it is counter-intuitive. Of course what is intuitive differs depending on the person, I just find it much more natural to put the condition first. I would never say, "I use my umbrella if it rains." I would say, "If it rains, I'll use my umbrella." Of course as the reply stated below, I could wrap the whole thing in parens and use && but that (IMO of course) is still not as intuitive as saying
if(COND) do_something(); I've been working with perl now for years and I still pause and scratch my head when I see that in code. I fear I'll never get used to it.
Either way, I didn't mean to say that it was only counter-intuitive in perl.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.