Prevent warnings on systems without $ENV{HOME} / $ENV{USER}
[app-lastmsg.git] / lib / App / Lastmsg.pm
index 0addd51d779a3643630b7c1cc24dd5b70436b425..a5a27b59c42af9fea88cebcfee4c86d870469561 100644 (file)
@@ -14,10 +14,9 @@ use POSIX qw/strftime/;
 our $OUTPUT_FILEHANDLE = \*STDOUT;
 our $VERSION = '0.001002';
 
-our @DEFAULT_INBOX = (
-       "/var/mail/$ENV{USER}",
-       "$ENV{HOME}/Maildir/",
-);
+our @DEFAULT_INBOX;
+push @DEFAULT_INBOX, "/var/mail/$ENV{USER}" if exists $ENV{USER};
+push @DEFAULT_INBOX, "$ENV{HOME}/Maildir"   if exists $ENV{HOME};
 
 sub run {
        my $config = Config::Auto->new(format => 'yaml')->parse;
This page took 0.009572 seconds and 4 git commands to generate.