in reply to undef vs 0

OEO, a zero that evaluates to true?, What is truth? (Curiosity corner)
$a = "0E0" || 1; die $a;
Have getConfigValue return the string "0E0", Or
my $foo = getFoo("foo") ; $foo = 1 unless defined $foo;
The real question is why write such a module when there are tons of them? Nevermind


MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
** The Third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: undef vs 0
by skx (Parson) on Feb 06, 2003 at 11:30 UTC
    The real question is why write such a module when there are tons of them?

     A valid question; basically because this is a perl re-implementation of some C code. The config file parser has to be 100% compatible with the old codes behaviour.

     Also it should be possible for the settings in the configuration file to be overridden by the contents of environmental variables, which no existing code I saw supported.

     (The environmental variable overrides is necessary for my testing scripts/testing system - fully automatic regression testing of the project as a whole, and the modules it is implmented via/with).

    Steve
    ---
    steve.org.uk