Subject: | $self->{args} needs work |
I'm using Regexp::Common 2.113 on Mac OS X 10.2.6 with perl 5.8.0.
The $self passed to subs() and matches() currently has (mostly undocumented) attributes $self->{args} and $self->{flags}.
1. $self->{args} currently includes all the flags as well as the name (as would be passed to create() as @$name). It should only have the name.
2. $self->{args} should therefore be called $self->{name}.
Both of these are fixed in the attached patch.
*** Regexp-Common-2.113/lib/Regexp/Common.pm Wed Apr 2 16:23:48 2003
--- Regexp-Common-patched/lib/Regexp/Common.pm Sun Jun 29 16:06:53 2003
***************
*** 137,143 ****
: /$fpat/ ? ($1 => undef)
: ()
} @args);
! $cache->{__VAL__}->_clone_with(\@args, \%flags);
}
use overload q{""} => \&_decache;
--- 137,143 ----
: /$fpat/ ? ($1 => undef)
: ()
} @args);
! $cache->{__VAL__}->_clone_with(\@nonflags, \%flags);
}
use overload q{""} => \&_decache;
***************
*** 251,257 ****
sub _clone_with {
my ($self, $args, $flags) = @_;
! bless { %$self, args=>$args, flags=>$flags }, ref $self;
}
--- 251,257 ----
sub _clone_with {
my ($self, $args, $flags) = @_;
! bless { %$self, flags=>$flags, name=>$args }, ref $self;
}