Skip Menu |

This queue is for tickets about the Text-Wrapper CPAN distribution.

Report information
The Basics
Id: 77386
Status: resolved
Priority: 0/
Queue: Text-Wrapper

People
Owner: Nobody in particular
Requestors: tsibley [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.03
Fixed in: 1.04



Subject: Relax perl version requirement?
Hi, Text::Wrapper 1.03 now sports a "use 5.010;" line for what seems like the sole purpose of being able to use the // operator (on a single line). Would you consider reverting the perl version requirement so that code which relies on Text::Wrapper isn't also tied to a perl 5.10.0 requirement? For example: RT uses Text::Wrapper, but has long promised compatibility with perl 5.8.3. We can't change the perl version requirement in the middle of a stable release series. I'm happy to provide a patch if you're amenable to the change. Best, Thomas
Here's a patch.
Subject: 0001-Relax-perl-version-requirement-to-5.8.0.patch
From 15622ced3e56d3f9e0237c318021d46b30f7118c Mon Sep 17 00:00:00 2001 From: Thomas Sibley <trs@bestpractical.com> Date: Wed, 23 May 2012 16:34:48 -0400 Subject: [PATCH] Relax perl version requirement to 5.8.0 --- lib/Text/Wrapper.pm | 5 +++-- t/10-wrapper.t | 2 +- t/20-unicode.t | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Text/Wrapper.pm b/lib/Text/Wrapper.pm index 083f734..009d2a7 100644 --- a/lib/Text/Wrapper.pm +++ b/lib/Text/Wrapper.pm @@ -17,7 +17,7 @@ package Text::Wrapper; # ABSTRACT: Word wrap text by breaking long lines #--------------------------------------------------------------------- -use 5.010; +use 5.008; use strict; use warnings; @@ -84,7 +84,7 @@ sub wrap_after if (@_) { $self->{_wrapRE} = $self->_build_wrap_re( - $self->{wrapAfter} = shift // '' + $self->{wrapAfter} = shift ); } @@ -98,6 +98,7 @@ our $hWS = ' \t\r\x{2000}-\x{200B}'; sub _build_wrap_re { my ($self, $chars) = @_; + $chars = '' unless defined $chars; return $_wrap_re_cache{$chars} ||= do { if (length $chars) { diff --git a/t/10-wrapper.t b/t/10-wrapper.t index 5f61c07..80f4473 100755 --- a/t/10-wrapper.t +++ b/t/10-wrapper.t @@ -3,7 +3,7 @@ # 10-wrapper.t #--------------------------------------------------------------------- -use 5.010; +use 5.008; use strict; use warnings; diff --git a/t/20-unicode.t b/t/20-unicode.t index 5a83e84..c9de7af 100644 --- a/t/20-unicode.t +++ b/t/20-unicode.t @@ -3,7 +3,7 @@ # 20-unicode.t #--------------------------------------------------------------------- -use 5.010; +use 5.008; use strict; use warnings; use utf8; -- 1.7.10
On Wed, May 23, 2012 2:02:26 PM, TSIBLEY wrote: Show quoted text
> Text::Wrapper 1.03 now sports a "use 5.010;" line for what seems like > the sole purpose of being able to use the // operator (on a single > line).
Well, I just felt that 4 years after 5.10.0 was released, it was about time to start taking advantage of some of its features. I've released version 1.04 with your patch, but I don't promise to maintain 5.8 compatibility. On the other hand, I have no current plans for an update to Text::Wrapper, so the issue isn't likely to come up soon.
On Fri May 25 13:01:55 2012, CJM wrote: Show quoted text
> Well, I just felt that 4 years after 5.10.0 was released, it was about > time to start taking advantage of some of its features.
Believe me, I completely understand that desire. :) defined-or is one of the nicer amenities of newer Perl. In our case, we're hoping to bump our perl requirement to something more recent by the end of this year with the next major release series of RT. Show quoted text
> I've released version 1.04 with your patch, but I don't promise to > maintain 5.8 compatibility. On the other hand, I have no current plans > for an update to Text::Wrapper, so the issue isn't likely to come up soon.
Thanks, the release is much appreciated.