diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2015-07-31 08:50:26 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2015-07-31 08:50:26 +0100 |
commit | 356231b051a1463a3d610e901a7671ed09a8626c (patch) | |
tree | f6448e1bc101adc93686207ac672e63a56ebbd82 /cpan/Filter-Util-Call | |
parent | 0dd5b0dc367b11288bb89a7180c049cda4b0ce90 (diff) | |
download | perl-356231b051a1463a3d610e901a7671ed09a8626c.tar.gz |
Upgrade Filter-Util-Call from version 1.54 to 1.55
Diffstat (limited to 'cpan/Filter-Util-Call')
-rw-r--r-- | cpan/Filter-Util-Call/Call.pm | 27 | ||||
-rw-r--r-- | cpan/Filter-Util-Call/Call.xs | 6 | ||||
-rw-r--r-- | cpan/Filter-Util-Call/filter-util.pl | 8 | ||||
-rw-r--r-- | cpan/Filter-Util-Call/t/rt_101033.pm | 27 | ||||
-rw-r--r-- | cpan/Filter-Util-Call/t/rt_101033.t | 11 |
5 files changed, 68 insertions, 11 deletions
diff --git a/cpan/Filter-Util-Call/Call.pm b/cpan/Filter-Util-Call/Call.pm index f282a1516d..8b4d41a821 100644 --- a/cpan/Filter-Util-Call/Call.pm +++ b/cpan/Filter-Util-Call/Call.pm @@ -1,7 +1,7 @@ - # Call.pm # # Copyright (c) 1995-2011 Paul Marquess. All rights reserved. +# Copyright (c) 2011-2014 Reini Urban. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. @@ -18,7 +18,7 @@ use vars qw($VERSION @ISA @EXPORT) ; @ISA = qw(Exporter DynaLoader); @EXPORT = qw( filter_add filter_del filter_read filter_read_exact) ; -$VERSION = "1.54" ; +$VERSION = "1.55" ; sub filter_read_exact($) { @@ -292,6 +292,29 @@ See L<Example 4: Using filter_del> for details. Internal function which adds the filter, based on the L<filter_add> argument type. +=item I<unimport()> + +May be used to disable a filter, but is rarely needed. See L<filter_del>. + +=back + +=head1 LIMITATIONS + +See L<perlfilter/LIMITATIONS> for an overview of the general problems +filtering code in a textual line-level only. + +=over + +=item __DATA__ is ignored + +The content from the __DATA__ block is not filtered. +This is a serious limitation, e.g. for the L<Switch> module. +See L<http://search.cpan.org/perldoc?Switch#LIMITATIONS> for more. + +=item Max. codesize limited to 32-bit + +Currently internal buffer lengths are limited to 32-bit only. + =back =head1 EXAMPLES diff --git a/cpan/Filter-Util-Call/Call.xs b/cpan/Filter-Util-Call/Call.xs index fd79c577a2..97280d7755 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.54 + * Version : 1.55 * * Copyright (c) 1995-2011 Paul Marquess. All rights reserved. * Copyright (c) 2011-2014 Reini Urban. All rights reserved. @@ -131,19 +131,15 @@ filter_call(pTHX_ int idx, SV *buf_sv, int maxlen) DEFSV_set(newSVpv("", 0)) ; PUSHMARK(sp) ; - if (CODE_REF(my_sv)) { /* if (SvROK(PERL_OBJECT(my_sv)) && SvTYPE(SvRV(PERL_OBJECT(my_sv))) == SVt_PVCV) { */ count = perl_call_sv((SV*)PERL_OBJECT(my_sv), G_SCALAR); } else { XPUSHs((SV*)PERL_OBJECT(my_sv)) ; - PUTBACK ; - count = perl_call_method("filter", G_SCALAR); } - SPAGAIN ; if (count != 1) diff --git a/cpan/Filter-Util-Call/filter-util.pl b/cpan/Filter-Util-Call/filter-util.pl index 1bc3bfbd93..44e8b1efdd 100644 --- a/cpan/Filter-Util-Call/filter-util.pl +++ b/cpan/Filter-Util-Call/filter-util.pl @@ -9,8 +9,8 @@ sub readFile my ($filename) = @_ ; my ($string) = '' ; - open (F, "<$filename") - or die "Cannot open $filename: $!\n" ; + open (F, "<", $filename) + or die "Cannot read $filename: $!\n" ; while (<F>) { $string .= $_ } close F ; @@ -20,8 +20,8 @@ sub readFile sub writeFile { my($filename, @strings) = @_ ; - open (F, ">$filename") - or die "Cannot open $filename: $!\n" ; + open (F, ">", $filename) + or die "Cannot write $filename: $!\n" ; binmode(F) if $filename =~ /bin$/i; foreach (@strings) { print F } diff --git a/cpan/Filter-Util-Call/t/rt_101033.pm b/cpan/Filter-Util-Call/t/rt_101033.pm new file mode 100644 index 0000000000..526a97cea1 --- /dev/null +++ b/cpan/Filter-Util-Call/t/rt_101033.pm @@ -0,0 +1,27 @@ +package rt_101033; + +use strict; +use Filter::Util::Call; + +sub import +{ + filter_add({}); + 1; +} + +sub unimport +{ + filter_del() +} + +sub filter +{ + my($self) = @_ ; + my $status = 1; + $status = filter_read(1_000_000); + #print "code: !$_!\n\n"; + return $status; +} + +1; + diff --git a/cpan/Filter-Util-Call/t/rt_101033.t b/cpan/Filter-Util-Call/t/rt_101033.t new file mode 100644 index 0000000000..4df361481d --- /dev/null +++ b/cpan/Filter-Util-Call/t/rt_101033.t @@ -0,0 +1,11 @@ +#! perl +use lib 't'; +use rt_101033; + +print "1..1\n"; +my $s = <DATA>; +print "not " if $s !~ /^test/; +print "ok 1 # TODO RT #101033 + Switch #97440 ignores __DATA__\n"; + +__DATA__ +test |