From ced497e2fca8b0ac1628855f422776e9bf331e65 Mon Sep 17 00:00:00 2001 From: Yitzchak Scott-Thoennes Date: Sun, 27 Nov 2005 17:26:31 -0800 Subject: Re: [perl #37731] junk and uninit'ed values in tied scalars Message-ID: <20051128092605.GA2328@efn.org> plus a regression test p4raw-id: //depot/perl@28684 --- t/op/tie.t | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 't') diff --git a/t/op/tie.t b/t/op/tie.t index 1d676eaa1c..a8d79fbc93 100755 --- a/t/op/tie.t +++ b/t/op/tie.t @@ -612,3 +612,13 @@ print scalar keys %h, "\n"; EXPECT 0 0 +######## +# Bug 37731 +sub foo::TIESCALAR { bless {value => $_[1]}, $_[0] } +sub foo::FETCH { $_[0]->{value} } +tie my $VAR, 'foo', '42'; +foreach my $var ($VAR) { + print +($var eq $VAR) ? "yes\n" : "no\n"; +} +EXPECT +yes -- cgit v1.2.1