Re: [ID 20010730.010] FETCH called twice with -T
authorAbigail <abigail@abigail.be>
Sat, 11 Aug 2001 23:49:49 +0000 (01:49 +0200)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 12 Aug 2001 13:56:42 +0000 (13:56 +0000)
Message-ID: <20010811214950.23255.qmail@foad.org>

p4raw-id: //depot/perl@11642

t/op/taint.t

index effb12c..592bb2a 100755 (executable)
@@ -109,7 +109,7 @@ print PROG 'print "@ARGV\n"', "\n";
 close PROG;
 my $echo = "$Invoke_Perl $ECHO";
 
-print "1..174\n";
+print "1..175\n";
 
 # First, let's make sure that Perl is checking the dangerous
 # environment variables. Maybe they aren't set yet, so we'll
@@ -839,3 +839,36 @@ else {
     print "ok 174\n";
 }
 
+
+{
+    # Bug ID 20010730.010
+
+    my $i = 0;
+
+    sub Tie::TIESCALAR {
+        my $class =  shift;
+        my $arg   =  shift;
+
+        bless \$arg => $class;
+    }
+
+    sub Tie::FETCH {
+        $i ++;
+        ${$_ [0]}
+    }
+
+    package main;
+    my $bar = "The Big Bright Green Pleasure Machine";
+    taint_these $bar;
+    tie my ($foo), Tie => $bar;
+
+    my $baz = $foo;
+
+    print $i == 1 ? "ok 175\n" : "not ok 175\n"
+
+}
+
+
+