This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[win32] yet another 'old' patch
authorStephane Payrard <stef@francenet.fr>
Mon, 2 Mar 1998 01:52:46 +0000 (01:52 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Mon, 2 Mar 1998 01:52:46 +0000 (01:52 +0000)
Message-Id: <199712040054.BAA04612@www.zweig.com>
To: perl5-porters@perl.org
Subject: Re: [PERL] buglet : minor but gratuitous inconsistency
between `my' and `local' (Patch included)

p4raw-id: //depot/win32/perl@611

op.c
t/op/my.t

diff --git a/op.c b/op.c
index 3a69670..f6857af 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1391,8 +1391,9 @@ my(OP *o)
     if (type == OP_LIST) {
        for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling)
            my(kid);
-    }
-    else if (type != OP_PADSV &&
+    } else if (type == OP_UNDEF) {
+       return op;
+    } else if (type != OP_PADSV &&
             type != OP_PADAV &&
             type != OP_PADHV &&
             type != OP_PUSHMARK)
index d439beb..1777e88 100755 (executable)
--- a/t/op/my.t
+++ b/t/op/my.t
@@ -10,7 +10,8 @@ sub foo {
     my $d;
     $c = "ok 3\n";
     $d = "ok 4\n";
-    { my($a,$c) = ("ok 9\n", "ok 10\n"); ($x, $y) = ($a, $c); }
+    { my($a, undef, $c) = ("ok 9\n", "not ok 10\n", "ok 10\n");
+      ($x, $y) = ($a, $c); }
     print $a, $b;
     $c . $d;
 }