]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/LxOfficeConf.pm
Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / SL / LxOfficeConf.pm
index 588e87f8bd215b035df674d5926ad809bc3830f6..f6ae49ef07d8bfa3b76fe3d6a3dc9ee9a94a24fd 100644 (file)
@@ -3,23 +3,24 @@ package SL::LxOfficeConf;
 use strict;
 
 use Encode;
-use SL::System::Process;
 
 my $environment_initialized;
 
 sub safe_require {
-  my ($class, $may_fail);
+  my ($class, $may_fail) = @_;
 
-  my $failed = !eval { require Config::Std; };
-
-  if ($failed) {
+  eval {
+    require Config::Std;
+    require SL::System::Process;
+    1;
+  } or do {
     if ($may_fail) {
       warn $@;
       return 0;
     } else {
       die $@;
     }
-  }
+  };
 
   Config::Std->import;