From a327f6f76d778aa12eddd09664ddf61c15a188e0 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 13 May 2006 10:36:18 +0000 Subject: [PATCH] Can't do require Foo if $tainted; because taint tunnels. (Documented, but I regard this as a serious practical deficiency in tainting) p4raw-id: //depot/perl@28185 --- lib/Tie/RefHash.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Tie/RefHash.pm b/lib/Tie/RefHash.pm index 30a90d9..2f09628 100644 --- a/lib/Tie/RefHash.pm +++ b/lib/Tie/RefHash.pm @@ -2,7 +2,7 @@ package Tie::RefHash; use vars qw/$VERSION/; -$VERSION = "1.34"; +$VERSION = "1.34_01"; =head1 NAME @@ -96,7 +96,12 @@ BEGIN { use Config (); my $usethreads = $Config::Config{usethreads}; # && exists $INC{"threads.pm"} *_HAS_THREADS = $usethreads ? sub () { 1 } : sub () { 0 }; - require Scalar::Util if $usethreads; # we need weaken() + if ($usethreads) { + # The magic of taint tunneling means that we can't do this require in the + # same statement as the boolean check on $usethreads, as $usethreads is + # tainted. + require Scalar::Util; + } } BEGIN { -- 1.8.3.1