lib/PublicInbox/Config.pm | 6 ++---- diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index f9184bd2872061411c7043592772da778a130346..ae9ad8deef9e910bd89c35388278522b388e47aa 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -19,7 +19,7 @@ # returns key-value pairs of config directives in a hash # if keys may be multi-value, the value is an array ref containing all values sub new { my ($class, $file) = @_; - $file = default_file() unless defined($file); + $file //= default_file(); my $self; if (ref($file) eq 'SCALAR') { # used by some tests open my $fh, '<', $file or die; # PerlIO::scalar @@ -136,9 +136,7 @@ sub config_dir { $ENV{PI_DIR} // "$ENV{HOME}/.public-inbox" } sub default_file { - my $f = $ENV{PI_CONFIG}; - return $f if defined $f; - config_dir() . '/config'; + $ENV{PI_CONFIG} // (config_dir() . '/config'); } sub config_fh_parse ($$$) {