diff options
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 |