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 reply to Re: undef vs 0
by ehdonhon
in thread undef vs 0
by skx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |