in reply to undef vs 0
In perl6, this will be easy:
my $value = getConfigValue( "use_foo" ) // 1;
In perl5, I think robartes has the right idea. Just to expand on it though, suppose you only want to call getConfigValue once for each value. You could do this:
my $value = defined($_ = getConfigValue( "use_foo" )) ? $_ : 1;
|
---|
In Section
Seekers of Perl Wisdom