At 23:01 +0000 10/19/03, martin@suttles.sca.sfbay.sun.com (via RT) wrote:
># New Ticket Created by martin@suttles.sca.sfbay.sun.com
># Please include the string: [perl #24250]
># in the subject line of all future correspondence about this issue.
># <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24250 >
>
>
>
>This is a bug report for perl from martin@suttles.sca.sfbay.sun.com,
>generated with the help of perlbug 1.34 running under perl v5.8.1.
>
>
>-----------------------------------------------------------------
>[Please enter your report here]
>Consider the following perl program
>
>my $count = 0;
>my $x = [sub() { $count },
> sub() { return $count },
> sub($) { $count += $_[0] }];
>$x->[2](3);
>printf "%d %d\n", $x->[0](), $x->[1]();
>
>This prints
>0 3
>when it should print
>3 3
Confirmed.
Please note that if you change:
my $count = 0;
to:
our $count = 0;
the result as is expected. So this would imply a lexical pad problem to me.
Furthermore, if you change:
my $count = 0;
to:
my $count = 'Foo';
the result is _still_:
0 3
which indicates to me the "0" is gotten from somewhere else, rather
than from $count.
Liz