diff --git a/i3-dmenu-desktop b/i3-dmenu-desktop index a0549ead..3b81cb20 100755 --- a/i3-dmenu-desktop +++ b/i3-dmenu-desktop @@ -25,7 +25,11 @@ binmode STDERR, ':utf8'; # reads in a whole file sub slurp { my ($filename) = @_; - open(my $fh, '<', $filename) or die "$!"; + my $fh; + if (!open($fh, '<', $filename)) { + warn "Could not open $filename: $!"; + return undef; + } local $/; my $result; eval {