From abe9dcd69fe0416fbddfecde4afb07c68c7d056b Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Mon, 26 Feb 2018 16:46:06 +0100 Subject: [PATCH 1/2] add warnings test --- t/01load.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/01load.t b/t/01load.t index c203d1a..166409b 100644 --- a/t/01load.t +++ b/t/01load.t @@ -6,6 +6,9 @@ # ====================================================================== use strict; -use Test::More tests => 1; +use Test::More tests => 2; +my @warnings; +$SIG{__WARN__} = sub { push @warnings, @_ }; use_ok('String::Format'); +is_deeply \@warnings, [], 'No warnings'; -- 2.7.4 From 2e0dcabde8b6d2add5123f0fe51d05f257c4e97d Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Mon, 26 Feb 2018 16:48:09 +0100 Subject: [PATCH 2/2] escape { and } (fix for RT #124147) { must be escaped for perl 5.32, and already throws warnings in earlier perl version. Escaping } is not strictly necessary, just done for orthogonality. --- Format.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Format.pm b/Format.pm index c355d05..74844ca 100644 --- a/Format.pm +++ b/Format.pm @@ -72,7 +72,7 @@ my $regex = qr/ (-)? # left-align, rather than right (\d*)? # (optional) minimum field width (?:\.(\d*))? # (optional) maximum field width - ({.*?})? # (optional) stuff inside + (\{.*?\})? # (optional) stuff inside (\S) # actual format character )/x; sub stringf { -- 2.7.4