summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2014-07-26 14:39:21 +0200
committergregor herrmann <gregoa@debian.org>2014-07-26 14:39:21 +0200
commit3dfd8f77865706507e6a97c7793325f2fd131c70 (patch)
treeba560082baf59850ed0ecd987704606a0a75a632 /bin
parent0d8e2bfa4e437b7d5f4bc521b98c09ccf6bb3bfb (diff)
Imported Upstream version 1.515
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mce_grep18
1 files changed, 12 insertions, 6 deletions
diff --git a/bin/mce_grep b/bin/mce_grep
index 6414ab5..cd82724 100755
--- a/bin/mce_grep
+++ b/bin/mce_grep
@@ -36,7 +36,12 @@
## --chunk-level={auto|file|list} option. For large files, choose file.
##
## ============================================================================
-## Created by Mario Roy, 2014-01-21, v1.008.
+## 2014-01-21 v1.008
+## Created by Mario Roy.
+## 2014-07-23 v1.009
+## ${^CHILD_ERROR_NATIVE} is not defined in Perl 5.8.x. Use $? instead.
+## Compute chunk_level => 'auto' to use 'file' when reading STDIN.
+## Set chunk_size to 8M when not specified (from 4M previously).
##
###############################################################################
@@ -91,7 +96,7 @@ Options for Many-core Engine:
chunk at [file] or [list] level
--chunk-size=NUM[KM] override chunk size (set at limit if under or over)
- [file] default: 4M minimum: 200K maximum: 20M
+ [file] default: 8M minimum: 200K maximum: 20M
[list] default: 12 minimum: 1 maximum: 60
--lang=LOCALE override locale
@@ -752,11 +757,12 @@ sub user_func_list {
my $err_file = MCE->sess_dir() .'/'. $chunk_id . '.err';
$$chunk_ref =~ s/\n/ /mg;
+ local $?;
if ($is_MSWin32) {
$err_file =~ s{/}{\\\\}g;
$output = `$cmd_path @args $$chunk_ref 2> $err_file`;
- $status = ${^CHILD_ERROR_NATIVE} >> 8;
+ $status = $? >> 8;
}
else {
local *STDERR_SAVE;
@@ -766,7 +772,7 @@ sub user_func_list {
open STDERR, '>&' . fileno $err_fh;
$output = `$cmd_path @args $$chunk_ref`;
- $status = ${^CHILD_ERROR_NATIVE} >> 8;
+ $status = $? >> 8;
open STDERR, '>&STDERR_SAVE';
close $err_fh;
@@ -878,7 +884,7 @@ my $gather_func;
if ($chunk_level eq 'auto') {
if (@files == 0 || $files[0] eq '-') {
- $chunk_level = $is_MSWin32 ? 'file' : 'list';
+ $chunk_level = 'file';
}
else {
if (-f $files[0]) {
@@ -905,7 +911,7 @@ if ($chunk_level eq 'list') {
);
}
else {
- $chunk_size = 4_194_304 unless defined $chunk_size; ## 4M
+ $chunk_size = 8_388_608 unless defined $chunk_size; ## 8M
$chunk_size = 20_971_520 if $chunk_size > 20_971_520; ## 20M
$chunk_size = 204_800 if $chunk_size < 204_800; ## 200K