From: Graham Knop Date: Tue, 4 Mar 2014 23:56:15 +0000 (-0500) Subject: test for taint mode using perl 5.6 compatible method X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FModule-Metadata.git;a=commitdiff_plain;h=698048aae1e0dc6b392843feab394f8eb0d28fa5 test for taint mode using perl 5.6 compatible method --- diff --git a/t/taint.t b/t/taint.t old mode 100644 new mode 100755 index ef527de..80ae7ea --- a/t/taint.t +++ b/t/taint.t @@ -2,7 +2,6 @@ use strict; use warnings; -use 5.008000; # for ${^TAINT} use Test::More tests => 2; use Module::Metadata; use Carp 'croak'; @@ -17,7 +16,8 @@ sub exception(&) { return $@; } -ok(${^TAINT}, 'taint flag is set'); +my $taint_on = ! eval { no warnings; join('',values %ENV), kill 0; 1; }; +ok($taint_on, 'taint flag is set'); # without the fix, we get: # Insecure dependency in eval while running with -T switch at lib/Module/Metadata.pm line 668, line 15.