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

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.

Whatever.




"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

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, 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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    [erix]: Nancy-Bari: 1320 km ... He'll need some time :)
    [LanX]: he was "meating" Italian monks oO?
    [erix]: then again, there are people who do 10 full triathlons on 10 consecutive days, so it must be doable
    choroba's friend has done the Pacific Crest Trail, it's 4200 km
    LanX Ladies and gentlemen: due to shortages of "Body of Christ" we have to resort to Body of Monks ...
    LanX ... buon appetito!
    [LanX]: Pacific Crest Trail is really hard stuff
    [Eily]: erix he plans to go as far as leuca

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (6)
    As of 2017-12-13 15:10 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      What programming language do you hate the most?




















      Results (369 votes). Check out past polls.

      Notices?