From 54c857314b7cab868fac7c4ac691845af7d2e747 Mon Sep 17 00:00:00 2001 From: Flavio Poletti Date: Fri, 15 May 2015 18:45:10 +0200 Subject: [PATCH] hopefully fixed issue with pipe open on Windows --- Changes | 3 +++ lib/App/Sets/Sort.pm | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 0ff91c2..ef3e0fb 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,7 @@ {{$NEXT}} + - hopefully fixed issue with pipe open on Windows + +0.973_04 2015-05-10 18:34:31 Europe/Rome - performance enhancement upon sorting - added command-line options for sort selection - added documentation diff --git a/lib/App/Sets/Sort.pm b/lib/App/Sets/Sort.pm index d3122c7..b7391c2 100644 --- a/lib/App/Sets/Sort.pm +++ b/lib/App/Sets/Sort.pm @@ -24,10 +24,9 @@ sub sort_filehandle { state $has_sort = ! $config->{internal_sort}; if ($has_sort) { - if (open my $fh, '-|', 'sort', '-u', $filename) { - return $fh; - } - WARN "cannot use system sort, falling back to internal implementation"; + my $fh; + eval { open $fh, '-|', 'sort', '-u', $filename } and return $fh; + WARN 'cannot use system sort, falling back to internal implementation'; $has_sort = 0; # from now on, use internal sort }