Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
A couple of nights ago, I was thinking a little, about Perl, about programming in general, about operators (especially "and" and "or" (or their higher precedence brothers "&&" and "||")) and I thought I would like a "but" operator. I told that to my girlfriend.

Well, she's no programmer but she does understand a programmer's way of thinking and she has some understanding of boolean logic.

So I told her I would like a "but" operator. Then she said, "that wouldn't be quite usefull, because that would make you able to say (pseudocode)  not EXPR-THIS but EXPR-THAT or  EXPR-THAT but not EXPR-THIS and in that case, you could as well just say  EXPR-THAT ."

Hmm, I thought. You are pretty right, actually. Then I discoverd that the importing mechanism does have something like a "but" operator (use MyModule qw(:standard !somesub)). But (<-- there it is) I didn't enjoy that one as much as a true "but" operator that would work a little like "and" and "or".

A long story made short: I (er... my girlfriend) concluded a "but" operator would be useless and I think it's a pity. I still like the abstract idea of having such a thing.


"2b"||!"2b";$$_="the question"
Besides that, my code is untested unless stated otherwise.
One more: please review the article about regular expressions (do's and don'ts) I'm working on.

In reply to A "but" operator. by muba

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, 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
  • 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (3)
    As of 2018-05-26 10:24 GMT
    Find Nodes?
      Voting Booth?