Use File::Which for searching binary
authorRicardo Mones <ricardo@mones.org>
Wed, 21 Nov 2018 23:14:05 +0000 (00:14 +0100)
committerRicardo Mones <ricardo@mones.org>
Wed, 21 Nov 2018 23:14:05 +0000 (00:14 +0100)
README
clawsker

diff --git a/README b/README
index 956703c..7378050 100644 (file)
--- a/README
+++ b/README
@@ -29,10 +29,12 @@ Dependencies
   GTK+3 bindings for Perl - https://gitlab.gnome.org/GNOME/perl-gtk3
   (>= 0.030)
   Locale::gettext - http://search.cpan.org/~pvandry/gettext-1.05/ (>= 1.05)
+  File::Which - https://metacpan.org/pod/File::Which (>= 1.21)
   Claws Mail - http://www.claws-mail.org (>= 3.9.1)
 
   On Debian systems:
-  # apt-get install libgtk3-perl liblocale-gettext-perl claws-mail
+  # apt-get install libgtk3-perl liblocale-gettext-perl libfile-which-perl
+  # apt-get install claws-mail
 
 Install
 -------
index b99b656..6c256b3 100755 (executable)
--- a/clawsker
+++ b/clawsker
@@ -20,6 +20,7 @@ use utf8;
 use version 0.77;
 use Glib qw(TRUE FALSE);
 use Gtk3;
+use File::Which;
 use POSIX qw(setlocale);
 use Locale::gettext;
 use Encode;
@@ -295,9 +296,8 @@ sub version_greater_or_equal {
 }
 
 sub get_claws_version {
-    $_ = qx/which claws-mail/;
-    chomp;
-    return "" unless ($_); # not installed
+    $_ = which ('claws-mail');
+    return "" unless defined $_; # not installed
     my $res = "";
     $_ = qx/$_ -v/;
     chomp;