Skip to content

Commit 6b89d6b

Browse files
neilbhaarg
authored andcommitted
Always rely on Clone::clone() as the provider of HTTP::Headers::clone()
Require at least 0.46 of Clone, which now supports back to Perl 5.8.1, thanks to a PR from HAARG.
1 parent 571bf09 commit 6b89d6b

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

Changes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Revision history for HTTP-Message
22

33
{{$NEXT}}
4+
- Made the Clone module a hard requirement, so we don't have to
5+
provide a fallback function for HTTP::Headers::clone().
6+
We require at least Clone 0.46, as that release now supports
7+
Perl back to 5.8.1, just like us. (GH#64) (Neil Bowers)
48

59
6.43 2022-10-22 14:50:35Z
610
- Remove dependency to IO::Uncompress::Bunzip2. (Michal Josef Spacek)

dist.ini

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ LWP::MediaTypes = 6
2222
MIME::Base64 = 2.1
2323
perl = 5.008001
2424
URI = 1.10
25+
Clone = 0.46
2526

2627
[@Author::OALDERS]
2728
; all these tests are TODO
@@ -35,11 +36,6 @@ URI = 1.10
3536
StaticInstall.mode = on
3637
StaticInstall.dry_run = 0
3738

38-
[Prereqs::Soften]
39-
to_relationship = suggests
40-
copy_to = develop.requires
41-
module = Clone
42-
4339
[Prereqs::Soften / Brotli]
4440
to_relationship = recommends
4541
copy_to = test.recommends

lib/HTTP/Headers.pm

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use warnings;
55

66
our $VERSION = '6.44';
77

8+
use parent 'Clone';
89
use Carp ();
910

1011
# The $TRANSLATE_UNDERSCORE variable controls whether '_' can be used
@@ -298,19 +299,6 @@ sub _process_newline {
298299
}
299300

300301

301-
302-
if (eval { require Clone; 1 }) {
303-
*clone = \&Clone::clone;
304-
} else {
305-
*clone = sub {
306-
my $self = shift;
307-
my $clone = HTTP::Headers->new;
308-
$self->scan(sub { $clone->push_header(@_);} );
309-
$clone;
310-
};
311-
}
312-
313-
314302
sub _date_header
315303
{
316304
require HTTP::Date;

0 commit comments

Comments
 (0)