Example: if( ! exists $dg_by_id{$group_id} and $group_id != 0) {}

Lately I've been writing scripts for an application with it's own lighter weight scripting language and a Perl API. The proprietrary language uses syntax such as

$model like /pattern/ $IPaddress in [ 192.168.0.0/24, 192.168.1.0/24 ] and $IPaddress not in + [ 192.168.0.1/32, 192.168.1.1/32]

, etc. Even in Perl scripts, we have to use some of their language to specify filters (like what to/not to run against) in the proprietary language format in a special comment block at the top. So, lately, even in Perl I've found myself writing 'and' instead of '&&" and ditto for 'or'. I'm not as fast to use 'not' instead of '!', but it's tempting. One benefit is for our non-programming users, they can make more sense of the Perl code.

My question is what's the risk/harm in using them like this? There's the low precedence that allows them to work, but I haven't been bitten by that yet (that I know of).

Elda Taluta; Sarks Sark; Ark Arks
My deviantART gallery


In reply to Thoughts on using and, or, and not over && || !? by Argel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.