Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Flip Flop IV

by holygrail (Scribe)
on Jun 24, 2001 at 21:59 UTC ( [id://91093]=note: print w/replies, xml ) Need Help??


in reply to Flip Flop IV

True and false aren't "values" in Perl. There is no boolean datatype. That is why you get errors when you use strict If you want to do it more elegantly and still use the "True" and "False" things, you could do something like this:
sub TRUE {return 1} sub FALSE {return 0} # Some assignments to $debug, doing something like # my $debug = TRUE; if ($debug == FALSE) { $debug = TRUE; } else { $debug = FALSE; }
Now you don't need to use 'eq' and just use '==', because TRUE and FALSE are now subroutines returning numerical values.

--HolyGrail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-26 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found