Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Is it possible to store an arthimetric operator in a variable?

by Adam (Vicar)
on Jul 19, 2005 at 15:18 UTC ( #476145=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Is it possible to store an arthimetric operator in a variable?
in thread Is it possible to store an arthimetric operator in a variable?

You are correct that the code isn't using the prototypes or requires the 1:0. I used them both, however, to be very clear to our anonymous reader what it was the code was doing. Also, I used 1:0 because I don't like using undef as a boolean false; it's not relevant here, but I find that 0 as false makes debugging easier which has led to this habit.


Comment on Re^3: Is it possible to store an arthimetric operator in a variable?
Re^4: Is it possible to store an arthimetric operator in a variable?
by ikegami (Pope) on Jul 19, 2005 at 15:22 UTC
    Boolean false isn't undef. Notice the lack of warnings in the following snippet:
    >perl -we "print(1==2)" >
      Sorry, you are right. It's "", which is just as useless in debugging... (it's been so long that I wrote a boolean function where I didn't use 0 that I forgot. Thank you.)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2014-10-02 05:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (49 votes), past polls