Change 31311 by [EMAIL PROTECTED] on 2007/05/30 13:59:17
Subject: Re: localising hash element by variable
From: [EMAIL PROTECTED]
Date: Wed, 30 May 2007 13:21:15 +0100
Message-Id: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/t/op/local.t#35 edit
Differences ...
==== //depot/perl/t/op/local.t#35 (xtext) ====
Index: perl/t/op/local.t
--- perl/t/op/local.t#34~31301~ 2007-05-29 01:41:09.000000000 -0700
+++ perl/t/op/local.t 2007-05-30 06:59:17.000000000 -0700
@@ -5,7 +5,7 @@
@INC = qw(. ../lib);
require './test.pl';
}
-plan tests => 117;
+plan tests => 120;
my $list_assignment_supported = 1;
@@ -442,4 +442,14 @@
ok(! exists($h{'k2'}));
is($h{'k1'},111);
}
-
+{
+ my %h=('k1' => 111);
+ our $k = 'k1'; # try dynamic too
+ {
+ local $h{$k}=222;
+ is($h{'k1'},222);
+ $k='k2';
+ }
+ ok(! exists($h{'k2'}));
+ is($h{'k1'},111);
+}
End of Patch.