use 5.010; use strict; use warnings; use MCE::Flow; die "Not enough arguments given\n" if @ARGV < 2; my $regex = shift; $regex = qr/$regex/; sub user_func { my ($mce, $slurp_ref, $chunk_id) = @_; if (my $match = ${ $slurp_ref } =~ $regex ? 1 : 0) { $mce->gather($match); $mce->abort; } } for my $filename (@ARGV) { my @match = mce_flow_f { use_slurpio => 1 }, \&user_func, $filename; say "File '$filename' does".( scalar @match ? "" : "n't" )." match"; }