http://qs1969.pair.com?node_id=233108


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;