Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^2: Perl ternary operator style

by holli (Monsignor)
on May 30, 2011 at 09:30 UTC ( #907290=note: print w/replies, xml ) Need Help??

in reply to Re: Perl ternary operator style
in thread Perl ternary operator style

Well, before calling other people misreader you better double check that it's not you who has actually misread.


You can lead your users to water, but alas, you cannot drown them.

Replies are listed 'Best First'.
Re^3: Perl ternary operator style
by SimonClinch (Deacon) on May 30, 2011 at 12:08 UTC
    So what in my post suggested that I didn't double check?

    Anyway, you were warned about it and even then, by inference, managed to misread the beginning of the OP! Who is it that has to double check? Try counting the number of function calls in the first code block of the OP.

    One world, one people

      ry counting the number of function calls in the first code block of the OP.

      You're right there are two function calls. But they are both called Function(), not Function1() and Function2() as in your example.

      Whirrr-click-whirrr. Yes. That's right. The OP is calling the same function twice!.

      And if you looked just a few lines further down, he acknowledges in his second code sample where he tries to avoid that:

      $Target = ($temp = Function($params)) ? $temp : $DefaultValue;

      It's one thing to misread a post, we've all done that. But to fail to double check when it is suggested you should; and then claim you already did; and then respond with such .... (I'll let you fill in the rest.)

      Nice one. I bet you're a Jackass fan aren't you.

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        I saw that it was the same function call - doh - but since the OP was giving it as an example of style as opposed to a specific code snippet, I considered that the general case of function1 and function2 was absolutely required in my response - function1 = function2 is a special case that doesn't affect the question of best syntax. On the other hand labelling them 1 and 2 is clearer.

        OK so one could say you checked the text of the OP, but surely it is reasonable to raise a theory of style to a reasonable level of abstraction and I am surprised you don't even see that that is what I wad doing. You really think adding 1 and 2 to the function names was a misread on my part? get real!

        One world, one people

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://907290]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-05-26 18:47 GMT
Find Nodes?
    Voting Booth?