i3-dmenu-desktop: do not die on failed open
This commit is contained in:
parent
868180565e
commit
7b1729a85b
|
@ -25,7 +25,11 @@ binmode STDERR, ':utf8';
|
||||||
# reads in a whole file
|
# reads in a whole file
|
||||||
sub slurp {
|
sub slurp {
|
||||||
my ($filename) = @_;
|
my ($filename) = @_;
|
||||||
open(my $fh, '<', $filename) or die "$!";
|
my $fh;
|
||||||
|
if (!open($fh, '<', $filename)) {
|
||||||
|
warn "Could not open $filename: $!";
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
local $/;
|
local $/;
|
||||||
my $result;
|
my $result;
|
||||||
eval {
|
eval {
|
||||||
|
|
Loading…
Reference in New Issue