From: Graham Knop Date: Thu, 28 May 2015 04:58:13 +0000 (-0400) Subject: only goto &UNIVERSAL::VERSION on perl 5.10+ X-Git-Tag: v2.000001~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=161de96d646141fb2bb8d28b000ce614c9286e2e;p=p5sagit%2Fstrictures.git only goto &UNIVERSAL::VERSION on perl 5.10+ We'd prefer to always use a goto when calling UNIVERSAL::VERSION, so that the error reporting shows the correct location. It seems to like segfaulting on some 5.8 builds though, so we're better off being safe and only doing it on 5.10+. --- diff --git a/lib/strictures.pm b/lib/strictures.pm index 8e95074..6809f4d 100644 --- a/lib/strictures.pm +++ b/lib/strictures.pm @@ -5,7 +5,9 @@ use warnings FATAL => 'all'; BEGIN { *_PERL_LT_5_8_4 = ($] < 5.008004) ? sub(){1} : sub(){0}; - *_CAN_GOTO_VERSION = ($] >= 5.008000) ? sub(){1} : sub(){0}; + # goto &UNIVERSAL::VERSION usually works on 5.8, but fails on some ARM + # machines. Seems to always work on 5.10 though. + *_CAN_GOTO_VERSION = ($] >= 5.010000) ? sub(){1} : sub(){0}; } our $VERSION = '2.000000';