I don’t have any answers, but perhaps the following will shed some light?
12:08 >perl -v
This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x
+86-multi-thread
...
12:08 >perl 318_SoPW.pl
1
2
Use of uninitialized value in print at 318_SoPW.pl line 27.
Use of uninitialized value in print at 318_SoPW.pl line 27.
1
2
3
Use of uninitialized value in print at 318_SoPW.pl line 27.
Use of uninitialized value in print at 318_SoPW.pl line 27.
Use of uninitialized value in print at 318_SoPW.pl line 27.
1
2
3
1
2
3
12:08 >
but
12:11 >perl -v
This is perl 5, version 16, subversion 0 (v5.16.0) built for MSWin32-x
+86-multi-thread-64int
(with 1 registered patch, see perl -V for more detail)
...
12:11 >perl 318_SoPW.pl
1
2
1
2
1
2
3
1
2
3
1
2
3
1
2
3
12:11 >
In neither case do I get a 4 in the output, as you do. Looks like there’s a Perl bug somewhere...
Update 1: Running on Vista 32-bit.
Update 2: With the local $_ line commented out, I get the following output (same for both perl versions):
17:59 >perl 318_SoPW.pl
Thread 1 terminated abnormally: Modification of a read-only value atte
+mpted at 318_SoPW.pl line 15.
Thread 2 terminated abnormally: Modification of a read-only value atte
+mpted at 318_SoPW.pl line 15.
18:00 >
Athanasius <°(((>< contra mundum