Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Ternary Quizical behaviour?

by Eily (Monsignor)
on Jul 10, 2020 at 12:40 UTC ( #11119140=note: print w/replies, xml ) Need Help??


in reply to Re: Ternary Quizical behaviour?
in thread Ternary Quizical behaviour?

But since the default is 0, this should mitigate the need for defined
I don't understand what you mean here. As far as I know, defined $test{'a'} ? $test{'a'} : 0 and $test{'a'} // 0 are strictly equivalent.

Beyond that ++ for the answer, the use of // here is a clear winner :)

Replies are listed 'Best First'.
Re^3: Ternary Quizical behaviour?
by perlfan (Vicar) on Jul 10, 2020 at 20:44 UTC
    I just said what you made clear, but I did so in a very awkward way. Thanks for the ++! :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11119140]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2021-10-26 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (90 votes). Check out past polls.

    Notices?