Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Terminology is not easy if it involves history and parallels to other (normative) languages.

see also

The Conditional operator is supported in many programming languages. This term usually refers to ?: as in C, C++, C#, Python, and JavaScript.

However, in Java, this term can also refer to && and ||

When Perl was born, C-programmers where one of the main target groups.

But as you see "Java" is doing it like you suggested.

And in Perl it's not only that

  • and has the same "flow control" like if
but also
  • if returns a value like the operand and

As I said, both are implemented with the same OP-Code.


At the same time we want documentation to stay concise, otherwise it's considered "too complicated"

I think adding an extra section "Control flow in conditional operators" with these deeper informations and linking to it from ?: and && or || might solve the issue.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

In reply to Re^4: Situation where warning "Found = in conditional, should be" seems obsolete (documentation - C terminology) by LanX
in thread Situation where warning "Found = in conditional, should be" seems obsolete by rsFalse

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 or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-10-05 12:58 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (24 votes). Check out past polls.