This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Filter-Util-Call from version 1.54 to 1.55
authorSteve Hay <steve.m.hay@googlemail.com>
Fri, 31 Jul 2015 07:50:26 +0000 (08:50 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Fri, 31 Jul 2015 07:50:26 +0000 (08:50 +0100)
MANIFEST
Porting/Maintainers.pl
cpan/Filter-Util-Call/Call.pm
cpan/Filter-Util-Call/Call.xs
cpan/Filter-Util-Call/filter-util.pl
cpan/Filter-Util-Call/t/rt_101033.pm [new file with mode: 0644]
cpan/Filter-Util-Call/t/rt_101033.t [new file with mode: 0644]
pod/perldelta.pod
pod/perlfilter.pod

index 3c81860..3966db4 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1160,6 +1160,8 @@ cpan/Filter-Util-Call/Call.pm     Filter::Util::Call extension module
 cpan/Filter-Util-Call/Call.xs  Filter::Util::Call extension external subroutines
 cpan/Filter-Util-Call/filter-util.pl           See if Filter::Util::Call works
 cpan/Filter-Util-Call/t/call.t See if Filter::Util::Call works
+cpan/Filter-Util-Call/t/rt_101033.pm
+cpan/Filter-Util-Call/t/rt_101033.t
 cpan/Filter-Util-Call/t/rt_54452-rebless.t
 cpan/Getopt-Long/lib/Getopt/Long.pm    Fetch command options (GetOptions)
 cpan/Getopt-Long/t/gol-basic.t         See if Getopt::Long works
index 4faee58..12f5ae5 100755 (executable)
@@ -562,7 +562,7 @@ use File::Glob qw(:case);
     },
 
     'Filter::Util::Call' => {
-        'DISTRIBUTION' => 'RURBAN/Filter-1.54.tar.gz',
+        'DISTRIBUTION' => 'RURBAN/Filter-1.55.tar.gz',
         'FILES'        => q[cpan/Filter-Util-Call
                  pod/perlfilter.pod
                 ],
index f282a15..8b4d41a 100644 (file)
@@ -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
index fd79c57..97280d7 100644 (file)
@@ -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)
index 1bc3bfb..44e8b1e 100644 (file)
@@ -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 (file)
index 0000000..526a97c
--- /dev/null
@@ -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 (file)
index 0000000..4df3614
--- /dev/null
@@ -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
index 01f87d5..6ace170 100644 (file)
@@ -123,6 +123,10 @@ L<Encode> has been upgraded from version 2.75 to 2.76.
 
 =item *
 
+L<Filter::Util::Call> has been upgraded from version 1.54 to 1.55.
+
+=item *
+
 The PathTools module collection has been upgraded from version 3.55 to
 3.56.
 
index 21df352..60d0864 100644 (file)
@@ -559,15 +559,17 @@ parser.
 The only stable usage for source filters are encryption, compression,
 or the byteloader, to translate binary code back to source code.
 
-See for example the limitations in Switch, which uses source filters,
+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 /.../
-delimiters and don't have a modifier //x are indistinguishable from
-code chunks beginning with the division operator /. As a workaround
-you must use m/.../ or m?...? for such patterns. Also, the presence of
-regexes specified with raw ?...? delimiters may cause mysterious
-errors. The workaround is to use m?...? instead.  See
-http://search.cpan.org/perldoc?Switch#LIMITATIONS
+regexes with embedded newlines that are specified with raw C</.../>
+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. 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.
 
 Currently internal buffer lengths are limited to 32-bit only.
 
@@ -582,7 +584,7 @@ Some source filters use the C<DATA> handle to read the calling program.
 When using these source filters you cannot rely on this handle, nor expect
 any particular kind of behavior when operating on it.  Filters based on
 Filter::Util::Call (and therefore Filter::Simple) do not alter the C<DATA>
-filehandle.
+filehandle, but on the other hand totally ignore the text after C<__DATA__>.
 
 =back
 
@@ -601,9 +603,11 @@ Damian Conway.
 
 Paul Marquess E<lt>Paul.Marquess@btinternet.comE<gt>
 
+Reini Urban E<lt>rurban@cpan.orgE<gt>
+
 =head1 Copyrights
 
-This article originally appeared in The Perl Journal #11, and is
-copyright 1998 The Perl Journal. It appears courtesy of Jon Orwant and
-The Perl Journal.  This document may be distributed under the same terms
-as Perl itself.
+The first version of this article originally appeared in The Perl
+Journal #11, and is copyright 1998 The Perl Journal. It appears
+courtesy of Jon Orwant and The Perl Journal.  This document may be
+distributed under the same terms as Perl itself.