The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTTP::Headers::Patch::DontUseStorable - Do not use Storable

VERSION

This document describes version 0.04 of HTTP::Headers::Patch::DontUseStorable (from Perl distribution HTTP-Headers-Patch-DontUseStorable), released on 2015-11-04.

SYNOPSIS

 use HTTP::Headers::Patch::DontUseStorable;

DESCRIPTION

HTTP::Headers (6.05 as of this writing) tries to load Storable (2.39 as of this writing) and use its dclone() method. Since Storable still does not support serializing Regexp objects, HTTP::Headers/HTTP::Message croaks when fed data with Regexp objects.

This patch avoids using Storable and clone using the alternative method.

FAQ

Is this a bug with HTTP::Headers? Why don't you submit a bug to HTTP-Message?

I tend not to think this is a bug with HTTP::Headers; after all, Storable's dclone() is a pretty standard way to clone data in Perl. This patch is more of a workaround for current Storable's deficiencies.

Shouldn't you add STORABLE_{freeze,thaw} methods to Regexp instead?

Yes, that's also one possible solution with the advantage of making Storable work with Regexp object everywhere, albeit with slightly more work for what I needed to accomplish (i.e. make Finance::Bank::ID::Mandiri work). There's an old distribution, Regexp::Copy (last release is 0.06 in 2003, at the time of this writing) which does this, but last time I tried it no longer works.

Why would an HTTP::Headers object contain a Regexp object in the first place? Shouldn't it only contain strings (and arrays/hashes of strings)?

True. This might be a bug with the client code (e.g. in my module which uses this patch, Finance::Bank::ID::Mandiri). I haven't investigated further though and this is the stop-gap solution.

SEE ALSO

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/HTTP-Headers-Patch-DontUseStorable.

SOURCE

Source repository is at https://github.com/perlancar/perl-HTTP-Headers-Patch-DontUseStorable.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=HTTP-Headers-Patch-DontUseStorable

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.