From: Karen Etheridge Date: Mon, 11 Jul 2016 22:17:29 +0000 (-0700) Subject: stringify version before comparing, as recommended by Zefram X-Git-Tag: v0.27~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8c34b0efb19410754cf5983c951dbc59d6df0774;hp=77ca541bd3eb0cfe62619a4d7f346965d4163691;p=p5sagit%2FTry-Tiny.git stringify version before comparing, as recommended by Zefram --- diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm index 39664d3..8aa11cc 100644 --- a/lib/Try/Tiny.pm +++ b/lib/Try/Tiny.pm @@ -167,7 +167,7 @@ sub finally (&;@) { package # hide from PAUSE Try::Tiny::ScopeGuard; - use constant UNSTABLE_DOLLARAT => ($] < '5.013002') ? 1 : 0; + use constant UNSTABLE_DOLLARAT => ("$]" < '5.013002') ? 1 : 0; sub _new { shift; diff --git a/t/basic.t b/t/basic.t index 18d8921..056c88d 100644 --- a/t/basic.t +++ b/t/basic.t @@ -131,7 +131,7 @@ sub Evil::new { bless { }, $_[0] } die "foo"; } catch { pass("catch invoked"); - local $TODO = "i don't think we can ever make this work sanely, maybe with SIG{__DIE__}" if $] < 5.014; + local $TODO = "i don't think we can ever make this work sanely, maybe with SIG{__DIE__}" if "$]" < 5.014; like($_, qr/foo/); }; diff --git a/t/context.t b/t/context.t index 1a57ba0..6386d44 100644 --- a/t/context.t +++ b/t/context.t @@ -55,7 +55,7 @@ sub run { finally { SKIP: { skip "DESTROY() not called in void context on perl $]", 1 - if $] < '5.008'; + if "$]" < '5.008'; is (wantarray, undef, "Proper VOID context in finally{} 1"); } return 'finally'; @@ -63,7 +63,7 @@ sub run { finally { SKIP: { skip "DESTROY() not called in void context on perl $]", 1 - if $] < '5.008'; + if "$]" < '5.008'; is (wantarray, undef, "Proper VOID context in finally{} 2"); } return 'finally'; diff --git a/t/given_when.t b/t/given_when.t index 4b61c50..95657dd 100644 --- a/t/given_when.t +++ b/t/given_when.t @@ -11,7 +11,7 @@ BEGIN { use Try::Tiny; use 5.010; -no if $] >= 5.017011, warnings => 'experimental::smartmatch'; +no if "$]" >= 5.017011, warnings => 'experimental::smartmatch'; my ( $error, $topic ); @@ -30,7 +30,7 @@ is( $error, "blah\n", "error caught" ); { local $TODO = "perhaps a workaround can be found" - if $] < 5.017003; + if "$]" < 5.017003; is( $topic, $error, 'error is also in $_' ); } diff --git a/t/when.t b/t/when.t index 2109421..fd0ccde 100644 --- a/t/when.t +++ b/t/when.t @@ -11,7 +11,7 @@ BEGIN { use Try::Tiny; use 5.010; -no if $] >= 5.017011, warnings => 'experimental::smartmatch'; +no if "$]" >= 5.017011, warnings => 'experimental::smartmatch'; my ( $foo, $bar, $other );