Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: Purpose of =~ and = in this statement

by Marshall (Canon)
on May 26, 2022 at 22:33 UTC ( [id://11144210]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Purpose of =~ and = in this statement
in thread Purpose of =~ and = in this statement

Thanks for the correction, my memory was fuzzy.

I think that this string "0 but true" is a very ancient artifact dating from before scientific notation. I have never seen this in my coding. I have however encountered "0E0" with the DBI as the normal, standard way to say "statement worked correctly, but produced a zero result", true in a logical comparison sense, but numeric zero in a numeric sense.

  • Comment on Re^5: Purpose of =~ and = in this statement

Replies are listed 'Best First'.
Re^6: Purpose of =~ and = in this statement
by afoken (Chancellor) on May 26, 2022 at 23:23 UTC

    "0 but true" is the self-documenting way to have a zero value evaluating to true, "0E0" is the clever but not so obvious one.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      I am not the judge or the author of either one of these variations. I simply report that 0E0 is in current use.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2025-05-16 04:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.