It's not legal now, but it may well become so in perl 6 since
?: is becoming
??:: in order to free up the colon (Larry hasn't told us what's going to happen to the question mark, but I wouldn't have a problem with making it a valid character in an identifier. I'd love to be able to write
given $employee {
when male? {...}
when female? {...}
default { "Ooh... neuter"; ... }
}
I tend to think that 'question form' methods/functions sit best in a functional or objective programming style; they seem to jar slightly when you're writing procedural stuff. But that could just be me.
Probably what will really happen is that Larry will show us some utterly clear and really useful trick that can be done with '?' as an operator and we'll gleefully use that and forget about using ?s in our identifiers.
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.