Skip to content

Storable is used in HTTP::Headers for cloning [rt.cpan.org #120310] #64

@oalders

Description

@oalders

Migrated from rt.cpan.org#120310 (status was 'new')

Requestors:

From me@eboxr.com on 2017-02-21 00:00:46:

Storable is used in HTTP::Headers and another internal fallback method is provided for the method 'clone'
Two minor issues there:
1 - there are not a single unit test which guarantee that the second clone method (without Storable) is working in the same way
2 - the method setting and check should probably happen at BEGIN time rather than run time.
3 - maybe we only need one method there, the faster, and we can probably assume that Storable is available on all System and if not simply list it as a dependencies for old perl versions

if (eval { require Storable; 1 }) {
     *clone = \&Storable::dclone;
 } else {
     *clone = sub {
     my $self = shift;
     my $clone = HTTP::Headers->new;
     $self->scan(sub { $clone->push_header(@_);} );
     $clone;
     };
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions