diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-05 22:27:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-05 22:27:26 +0000 |
commit | b56b320b5e2515160073fa1b469514002688fe11 (patch) | |
tree | 965a7100c5e45fca8ec803d22b8b6ce14fca4633 /Master/tlpkg/tlperl/lib/Filter | |
parent | d26c206452d2e285c3bbf949f34011e4a55fd8f9 (diff) |
tlperl 5.22.1 from siep
git-svn-id: svn://tug.org/texlive/trunk@40252 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Filter')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Filter/Simple.pm | 6 | ||||
-rw-r--r-- | Master/tlpkg/tlperl/lib/Filter/Util/Call.pm | 20 |
2 files changed, 17 insertions, 9 deletions
diff --git a/Master/tlpkg/tlperl/lib/Filter/Simple.pm b/Master/tlpkg/tlperl/lib/Filter/Simple.pm index 4b15e556e00..82129192b82 100644 --- a/Master/tlpkg/tlperl/lib/Filter/Simple.pm +++ b/Master/tlpkg/tlperl/lib/Filter/Simple.pm @@ -4,7 +4,7 @@ use Text::Balanced ':ALL'; use vars qw{ $VERSION @EXPORT }; -$VERSION = '0.91'; +$VERSION = '0.92'; use Filter::Util::Call; use Carp; @@ -119,8 +119,8 @@ sub gen_std_filter_for { } if ($type =~ /^code/) { my $count = 0; - local $placeholder = qr/\Q$;\E(\C{4})\Q$;\E/; - my $extractor = qr/\Q$;\E(\C{4})\Q$;\E/; + local $placeholder = qr/\Q$;\E(.{4})\Q$;\E/s; + my $extractor = qr/\Q$;\E(.{4})\Q$;\E/s; $_ = join "", map { ref $_ ? $;.pack('N',$count++).$; : $_ } @components; diff --git a/Master/tlpkg/tlperl/lib/Filter/Util/Call.pm b/Master/tlpkg/tlperl/lib/Filter/Util/Call.pm index fb379b019cb..f282a1516d5 100644 --- a/Master/tlpkg/tlperl/lib/Filter/Util/Call.pm +++ b/Master/tlpkg/tlperl/lib/Filter/Util/Call.pm @@ -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.49" ; +$VERSION = "1.54" ; sub filter_read_exact($) { @@ -45,12 +45,12 @@ sub filter_add($) my($obj) = @_ ; # Did we get a code reference? - my $coderef = (ref $obj eq 'CODE') ; + my $coderef = (ref $obj eq 'CODE'); # If the parameter isn't already a reference, make it one. - $obj = \$obj unless ref $obj ; - - $obj = bless ($obj, (caller)[0]) unless $coderef ; + if (!$coderef and (!ref($obj) or ref($obj) =~ /^ARRAY|HASH$/)) { + $obj = bless (\$obj, (caller)[0]); + } # finish off the installation of the filter in C. Filter::Util::Call::real_import($obj, (caller)[0], $coderef) ; @@ -193,7 +193,7 @@ If a CODE reference is used then a I<closure filter> will be assumed. If a CODE reference is not used, a I<method filter> will be assumed. In a I<method filter>, the reference can be used to store context information. The reference will be I<blessed> into the package by -C<filter_add>. +C<filter_add>, unless the reference was already blessed. See the filters at the end of this documents for examples of using context information using both I<method filters> and I<closure @@ -498,5 +498,13 @@ Paul Marquess 26th January 1996 +=head1 LICENSE + +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. + =cut |