This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update the is_tainted() example implementation.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 6 Sep 2001 13:30:32 +0000 (13:30 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 6 Sep 2001 13:30:32 +0000 (13:30 +0000)
p4raw-id: //depot/perl@11914

pod/perlsec.pod

index 87d1f7b..e8d44c3 100644 (file)
@@ -125,10 +125,7 @@ nearby CPAN mirror, and included in Perl starting from the release 5.8.0.
 Or you may be able to use the following I<is_tainted()> function.
 
     sub is_tainted {
-       return ! eval {
-           join('',@_), kill 0;
-           1;
-       };
+        return ! eval { eval("#" . substr(join("", @_), 0, 0)); 1 };
     }
 
 This function makes use of the fact that the presence of tainted data