#!/usr/bin/env perl
# vim:ts=4:sw=4:expandtab
#
-# © 2012-2014 Michael Stapelberg
+# © 2012 Michael Stapelberg
#
# No dependencies except for perl ≥ v5.10
# 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 {
'dmenu=s' => \$dmenu_cmd,
'entry-type=s' => \@entry_types,
'version' => sub {
- say "dmenu-desktop 1.5 © 2012-2013 Michael Stapelberg";
+ say "dmenu-desktop 1.5 © 2012 Michael Stapelberg";
exit 0;
},
'help' => sub {
# };
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
-# ┃ Run dmenu to ask the user for their choice ┃
+# ┃ Run dmenu to ask the user for their choice ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
# open2 will just make dmenu’s STDERR go to our own STDERR.