summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xPorting/Maintainers.pl2
-rw-r--r--cpan/Filter-Util-Call/Call.pm8
-rw-r--r--cpan/Filter-Util-Call/Call.xs2
-rw-r--r--cpan/Filter-Util-Call/filter-util.pl12
-rw-r--r--cpan/Filter-Util-Call/t/call.t49
-rw-r--r--cpan/Filter-Util-Call/t/rt_101033.t2
-rw-r--r--cpan/Filter-Util-Call/t/rt_54452-rebless.t3
-rw-r--r--pod/perlfilter.pod6
8 files changed, 55 insertions, 29 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index d9445c7553..0d0d03723b 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -523,7 +523,7 @@ use File::Glob qw(:case);
},
'Filter::Util::Call' => {
- 'DISTRIBUTION' => 'RURBAN/Filter-1.55.tar.gz',
+ 'DISTRIBUTION' => 'RURBAN/Filter-1.57.tar.gz',
'FILES' => q[cpan/Filter-Util-Call
pod/perlfilter.pod
],
diff --git a/cpan/Filter-Util-Call/Call.pm b/cpan/Filter-Util-Call/Call.pm
index 8b4d41a821..f5c1e7beb1 100644
--- a/cpan/Filter-Util-Call/Call.pm
+++ b/cpan/Filter-Util-Call/Call.pm
@@ -2,6 +2,7 @@
#
# Copyright (c) 1995-2011 Paul Marquess. All rights reserved.
# Copyright (c) 2011-2014 Reini Urban. All rights reserved.
+# Copyright (c) 2014-2017 cPanel Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
@@ -14,11 +15,13 @@ require Exporter;
use Carp ;
use strict;
use warnings;
-use vars qw($VERSION @ISA @EXPORT) ;
+use vars qw($VERSION $XS_VERSION @ISA @EXPORT) ;
@ISA = qw(Exporter DynaLoader);
@EXPORT = qw( filter_add filter_del filter_read filter_read_exact) ;
-$VERSION = "1.55" ;
+$VERSION = "1.57" ;
+$XS_VERSION = $VERSION;
+$VERSION = eval $VERSION;
sub filter_read_exact($)
{
@@ -525,6 +528,7 @@ Paul Marquess
Copyright (c) 1995-2011 Paul Marquess. All rights reserved.
Copyright (c) 2011-2014 Reini Urban. All rights reserved.
+Copyright (c) 2014-2017 cPanel Inc. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/cpan/Filter-Util-Call/Call.xs b/cpan/Filter-Util-Call/Call.xs
index 97280d7755..487c20b327 100644
--- a/cpan/Filter-Util-Call/Call.xs
+++ b/cpan/Filter-Util-Call/Call.xs
@@ -3,7 +3,7 @@
*
* Author : Paul Marquess
* Date : 2014-12-09 02:48:44 rurban
- * Version : 1.55
+ * Version : 1.57
*
* Copyright (c) 1995-2011 Paul Marquess. All rights reserved.
* Copyright (c) 2011-2014 Reini Urban. All rights reserved.
diff --git a/cpan/Filter-Util-Call/filter-util.pl b/cpan/Filter-Util-Call/filter-util.pl
index 44e8b1efdd..a8755e41f5 100644
--- a/cpan/Filter-Util-Call/filter-util.pl
+++ b/cpan/Filter-Util-Call/filter-util.pl
@@ -30,7 +30,7 @@ sub writeFile
sub ok
{
- my($number, $result, $note) = @_ ;
+ my ($number, $result, $note) = @_ ;
$note = "" if ! defined $note ;
if ($note) {
@@ -40,11 +40,17 @@ sub ok
print "not " if !$result ;
print "ok ${number}${note}\n";
+ return $result;
+}
+
+sub diag {
+ print STDERR
+ (map { /^#/ ? "$_\n" : "# $_\n" }
+ map { split /\n/ } @_);
}
$Inc = '' ;
-foreach (@INC)
- { $Inc .= "\"-I$_\" " }
+foreach (@INC) { $Inc .= "\"-I$_\" " }
$Inc = "-I::lib" if $^O eq 'MacOS';
$Perl = '' ;
diff --git a/cpan/Filter-Util-Call/t/call.t b/cpan/Filter-Util-Call/t/call.t
index b1e32c4401..7da20be95f 100644
--- a/cpan/Filter-Util-Call/t/call.t
+++ b/cpan/Filter-Util-Call/t/call.t
@@ -1,12 +1,12 @@
+use Config;
BEGIN {
- if ($ENV{PERL_CORE}){
- require Config; import Config;
- %Config=%Config if 0; # cease -w
+ if ($ENV{PERL_CORE}) {
if ($Config{'extensions'} !~ m{\bFilter/Util/Call\b}) {
print "1..0 # Skip: Filter::Util::Call was not built\n";
exit 0;
}
}
+ unshift @INC, 't';
require 'filter-util.pl';
}
@@ -23,9 +23,9 @@ use Cwd ;
my $here = getcwd ;
-my $filename = "call.tst" ;
-my $filename2 = "call2.tst" ;
-my $filenamebin = "call.bin" ;
+my $filename = "call$$.tst" ;
+my $filename2 = "call2$$.tst" ;
+my $filenamebin = "call$$.bin" ;
my $module = "MyTest" ;
my $module2 = "MyTest2" ;
my $module3 = "MyTest3" ;
@@ -68,14 +68,27 @@ sub import { filter_add() }
1 ;
EOM
-
+
$a = `$Perl "-I." $Inc -e "use ${module} ;" $redir` ;
-ok(3, (($? >>8) != 0 or (($^O eq 'MSWin32' || $^O eq 'MacOS' || $^O eq 'NetWare' || $^O eq 'mpeix') && $? != 0))) ;
+#warn "# $a\n";
+ok(3, (($? >>8) != 0
+ or (($^O eq 'MSWin32' || $^O eq 'MacOS' || $^O eq 'NetWare' || $^O eq 'mpeix')
+ && $? != 0))) ;
#ok(4, $a =~ /^usage: filter_add\(ref\) at ${module}.pm/) ;
-ok(4, $a =~ /^Not enough arguments for Filter::Util::Call::filter_add/m) ;
-
-
-
+my $errmsg = $Config{usecperl}
+ ? qr/^Not enough arguments for subroutine entry Filter::Util::Call::filter_add at ${module}\.pm line/m
+ : qr/^Not enough arguments for Filter::Util::Call::filter_add at ${module}\.pm line/m;
+$a =~ s/^(.*?\n).*$/$1/s; # only the first line
+if ($] < 5.007) {
+ if ($a =~ $errmsg) {
+ ok(4, 1);
+ } else {
+ ok(4, 1, "TODO");
+ }
+} else {
+ ok(4, $a =~ $errmsg, 'usage error')
+ or diag("The error was: ", $a);
+}
# non-error cases
#################
@@ -92,9 +105,9 @@ use Filter::Util::Call ;
sub import {
filter_add(
sub {
-
+
my ($status) ;
-
+
if (($status = filter_read()) > 0) {
s/ABC/DEF/g
}
@@ -214,20 +227,20 @@ sub import { filter_add(
sub
{
my ($status) ;
-
+
if (($status = filter_read()) > 0) {
s/Fred/Joe/g
}
$status ;
} ) ;
}
-
+
1 ;
EOM
-
+
writeFile("${module4}.pm", <<EOM) ;
package ${module4} ;
-
+
use $module5 ;
print "I'm feeling used!\n" ;
diff --git a/cpan/Filter-Util-Call/t/rt_101033.t b/cpan/Filter-Util-Call/t/rt_101033.t
index 4df361481d..2c4a323d81 100644
--- a/cpan/Filter-Util-Call/t/rt_101033.t
+++ b/cpan/Filter-Util-Call/t/rt_101033.t
@@ -4,7 +4,7 @@ use rt_101033;
print "1..1\n";
my $s = <DATA>;
-print "not " if $s !~ /^test/;
+print "not " if !$s or $s !~ /^test/;
print "ok 1 # TODO RT #101033 + Switch #97440 ignores __DATA__\n";
__DATA__
diff --git a/cpan/Filter-Util-Call/t/rt_54452-rebless.t b/cpan/Filter-Util-Call/t/rt_54452-rebless.t
index b6f7aa02ef..c212b2d1ee 100644
--- a/cpan/Filter-Util-Call/t/rt_54452-rebless.t
+++ b/cpan/Filter-Util-Call/t/rt_54452-rebless.t
@@ -8,8 +8,9 @@ if ($] < 5.004_55) {
use strict;
use warnings;
+BEGIN { unshift @INC, 't'; }
-require "./filter-util.pl" ;
+require "filter-util.pl" ;
use vars qw( $Inc $Perl) ;
diff --git a/pod/perlfilter.pod b/pod/perlfilter.pod
index f81ee8a1c0..60d086401c 100644
--- a/pod/perlfilter.pod
+++ b/pod/perlfilter.pod
@@ -562,9 +562,11 @@ or the byteloader, to translate binary code back to source code.
See for example the limitations in L<Switch>, which uses source filters,
and thus is does not work inside a string eval, the presence of
regexes with embedded newlines that are specified with raw C</.../>
-delimiters and don't have a modifier C</x> are indistinguishable from
+delimiters and don't have a modifier C<//x> are indistinguishable from
code chunks beginning with the division operator C</>. As a workaround
-you must use C<m/.../> or C<m?...?> for such patterns. See
+you must use C<m/.../> or C<m?...?> for such patterns. Also, the presence of
+regexes specified with raw C<?...?> delimiters may cause mysterious
+errors. The workaround is to use C<m?...?> instead. See
L<http://search.cpan.org/perldoc?Switch#LIMITATIONS>
Currently the content of the C<__DATA__> block is not filtered.