Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found