Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: On TRUE and FALSE

by Rhose (Priest)
on Jun 20, 2003 at 17:04 UTC ( #267655=note: print w/ replies, xml ) Need Help??


in reply to On TRUE and FALSE
in thread Code to solve the "matrix formation" puzzle

Good point.

While I never use these constants for anything other than setting variables I declare, it would be easy to use them otherwise. I started this habit when I was first learning perl as a way of distinguishing "logical" and "numerics" in my code and for setting "logical" options in some modules (like DBI).

For example:

$gDBHandle = DBI->connect ( 'dbi:Oracle:' . ORATNS, ORAUSER, ORAPASS, { AutoCommit => FALSE, PrintError => FALSE, RaiseError => FALSE, } ) || die 'Could not connect to Oracle ['.$DBI::errstr.' - '.$DBI::er +r.']';
This just helped me remember I was turning "off" those options instead of setting some "numeric" to zero.

Thank you for the suggestion.


Comment on Re: On TRUE and FALSE
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2015-07-03 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls