Runtime-loading the ParamParser loads Encode, which blows away $_ and
pos. Carefully save these values around the module load so that things
don't blow up.
+ - Fix a weird interaction between match-spec parsing and module loading
+ that was causing brokenness and test failures with perl 5.8.8
+
0.012 - 2012-01-30
- Added match predicates match_true and match_false
- Added '~' to match an empty path
sub _param_matcher {
my ($type, $spec) = @_;
- require Web::Dispatch::ParamParser;
+ # We're probably parsing a match spec while building the parser, and
+ # on 5.8.8, loading ParamParser loads Encode which blows away $_ and pos.
+ # Furthermore, localizing $_ doesn't restore pos afterwards. So do this
+ # stupid thing instead to work on 5.8.8
+ my $saved_pos = pos;
+ {
+ local $_;
+ require Web::Dispatch::ParamParser;
+ }
+ pos = $saved_pos;
my $unpack = Web::Dispatch::ParamParser->can("get_unpacked_${type}_from");
sub {
_extract_params($unpack->($_[0]), $spec)