libwww-perl / libwww-perl/HTTP-Message

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

Open
#64 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
32
Forks
63
Avg merge
5h 14m
Merged PRs (30d)
1

Description

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

Requestors:

  • me@eboxr.com

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;
     };
 }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the HTTP::Headers clone implementation and its existing unit tests, then inspect how the Storable fallback is selected. Reproduce the clone behavior with and without Storable and use the issue's three concerns to define completion: equivalent test coverage and a resolved loading or dependency decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.