diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index cc26394623b4..403b3f759877 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -524,7 +524,7 @@ package Maintainers; }, 'Filter::Util::Call' => { - 'DISTRIBUTION' => 'RURBAN/Filter-1.57.tar.gz', + 'DISTRIBUTION' => 'RURBAN/Filter-1.58.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 f5c1e7beb194..cfe9cb78863e 100644 --- a/cpan/Filter-Util-Call/Call.pm +++ b/cpan/Filter-Util-Call/Call.pm @@ -9,18 +9,17 @@ package Filter::Util::Call ; -require 5.005 ; -require DynaLoader; +require 5.006 ; # our require Exporter; -use Carp ; + +use XSLoader (); use strict; use warnings; -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.57" ; -$XS_VERSION = $VERSION; +our @ISA = qw(Exporter); +our @EXPORT = qw( filter_add filter_del filter_read filter_read_exact) ; +our $VERSION = "1.58" ; +our $XS_VERSION = $VERSION; $VERSION = eval $VERSION; sub filter_read_exact($) @@ -29,8 +28,10 @@ sub filter_read_exact($) my ($left) = $size ; my ($status) ; - croak ("filter_read_exact: size parameter must be > 0") - unless $size > 0 ; + unless ( $size > 0 ) { + require Carp; + Carp::croak("filter_read_exact: size parameter must be > 0"); + } # try to read a block which is exactly $size bytes long while ($left and ($status = filter_read($left)) > 0) { @@ -59,7 +60,7 @@ sub filter_add($) Filter::Util::Call::real_import($obj, (caller)[0], $coderef) ; } -bootstrap Filter::Util::Call ; +XSLoader::load('Filter::Util::Call'); 1; __END__ diff --git a/cpan/Filter-Util-Call/Call.xs b/cpan/Filter-Util-Call/Call.xs index 487c20b32783..74c367625745 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.57 + * Version : 1.58 * * 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/t/call.t b/cpan/Filter-Util-Call/t/call.t index 7da20be95f5a..b2a0cad95f00 100644 --- a/cpan/Filter-Util-Call/t/call.t +++ b/cpan/Filter-Util-Call/t/call.t @@ -15,9 +15,9 @@ use warnings; use vars qw($Inc $Perl); -print "1..32\n" ; +print "1..34\n"; -$Perl = "$Perl -w" ; +$Perl = "$Perl -w"; use Cwd ; my $here = getcwd ; @@ -39,39 +39,39 @@ my $redir = $^O eq 'MacOS' ? "" : "2>&1"; # Test error cases ################## -# no filter function in module +# no filter function in module ############################### writeFile("${module}.pm", <>8) != 0 or (($^O eq 'MSWin32' || $^O eq 'MacOS' || $^O eq 'NetWare' || $^O eq 'mpeix') && $? != 0))) ; ok(2, $a =~ /^Can't locate object method "filter" via package "MyTest"/m) ; - + # no reference parameter in filter_add ###################################### writeFile("${module}.pm", <>8) != 0 +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/) ; @@ -99,17 +99,17 @@ if ($] < 5.007) { writeFile("${module}.pm", < 0) { - s/ABC/DEF/g + s/ABC/DEF/g } $status ; } ) ; @@ -117,7 +117,7 @@ sub import { 1 ; EOM - + writeFile($filename, < 0) { s/ABC/DEF/g } $status ; } - + 1 ; EOM - + writeFile($filename, <>8) == 0) ; ok(8, $a eq < 0) { s/XYZ/PQR/g } $status ; } - + 1 ; EOM - + writeFile("${module3}.pm", < 0) { s/Today/Tomorrow/g } $status ; } - + 1 ; EOM writeFile($filename, < 0) { foreach $pattern (@strings) { s/$pattern/PQR/g } } - + $status ; } ) - + } 1 ; EOM - - + + writeFile($filename, <>8) == 0) ; ok(12, $a eq < 0) { foreach $pattern (@$self) { s/$pattern/PQR/g } @@ -400,25 +400,25 @@ sub filter $status ; } - + 1 ; EOM - - + + writeFile($filename, <>8) == 0) ; ok(14, $a eq < 0) { chop ; @@ -459,32 +459,33 @@ sub filter $status ; } - + 1 ; EOM - - + + writeFile($filename, <>8) == 0) ; ok(16, $a eq <>8) == 0) ; ok(18, $a eq < 0) { s/DIR/$here/g } $status ; } - + 1 ; EOM @@ -573,7 +574,7 @@ use $block ; EOM print "We are in DIR\n" ; EOM - + $a = `$Perl "-I." $Inc $filename $redir` ; ok(19, ($? >>8) == 0) ; ok(20, $a eq < 0 ; @@ -612,10 +613,10 @@ sub filter $status ; } - + 1 ; EOM - + writeFile($filename, <>8) == 0) ; ok(22, $a eq < 0) { s/HERE/THERE/g } - + $status ; } - + 1 ; EOM - + writeFile($filenamebin, <>8) == 0) ; ok(24, $a eq < 0) { s/HERE/THERE/g } - + $status ; } - + 1 ; EOM - + writeFile($filename, <>8) == 0) ; ok(26, $a eq < 0) { s/HERE/THERE/g } - + $status ; } - + 1 ; EOM - + writeFile($filename, <>8) == 0) ; ok(28, $a eq < 0 +###################################### + +writeFile("${block}.pm", < 0) { + s/HERE/THERE/g + } + $status ; +} + +1 ; +EOM + +writeFile($filenamebin, <>8) != 0) ; +ok(34, $a =~ /^filter_read_exact: size parameter must be > 0 at block.pm/) ; + + END { 1 while unlink $filename ; 1 while unlink $filename2 ;