To my eyes, [ $condition => $value ] reads better.
I personally believe that it's not that important: I gave a... wild shot, if you know what I mean. Of course one may want some sort of full fledged solution taking care of all possible cases. For the present situation, your expression is fine enough, but just that little much too complex wrt "mine." I may have used something like that too, of course.
However, as a sort of justification, I was thinking much of the postponed condition in analogy with an if statement modifier, that can be thought of as an optional parameter and be there or not...
Also allows you to do: [ $condition => $list, $of, $values ]
And then again, one may want to do [ $value => @conditions ] instead: again It depends on the actual situation and there's not a clear-cut, all-encompassing answer. (There may be, if we wanted to make it into a real module, with a well thought API, and so on, but that's not the case...)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||