opening $0 doesn't work if you change directory. So use test.pl
authorNicholas Clark <nick@ccl4.org>
Wed, 7 Feb 2007 23:54:53 +0000 (23:54 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 7 Feb 2007 23:54:53 +0000 (23:54 +0000)
p4raw-id: //depot/perl@30168

t/op/taint.t

index f661108..84600e4 100755 (executable)
@@ -1223,9 +1223,9 @@ SKIP:
     is ($val, 0, "eval doesn't like tainted strings");
     like ($@, qr/^Insecure dependency in eval/);
 
-    # Rather nice code to get a tainted by from Rick Delaney
-    open 0 or die $!;
-    $tainted=(<0>,<0>);
+    # Rather nice code to get a tainted undef by from Rick Delaney
+    open FH, "test.pl" or die $!;
+    $tainted=(<FH>,<FH>);
 
     eval 'eval $tainted';
     like ($@, qr/^Insecure dependency in eval/);