Yesterday I was playing around with a little snippet, and uncovered a bug that results in the special array @- reporting a huge number of elements. After a little CB discussion, it seemed that this issue only affects some people, and some versions of Perl, built on some systems. (Is that vague enough?)
Here is a test snippet that will produce the bug -- that is, if it is going to manifest itself on your system. Give it a try and boggle at the output.
use strict; use warnings; my $string = "abc"; while( $string =~ /b/g ) { print $#-, "\n"; }
And the output...
22350300
Again, your mileage will vary. The output is different for everyone. Some people will correctly see '0', others will see some huge number. I see '22350300'. I'm using ActiveState Perl 5.8.6 on Win32.
I'm posting this as a SoPW because I'm interested in discovering a common thread between those who do see the behavior. I'd also be interested in hearing speculation (or definitive answers) as to what is going on here.
Dave
In reply to @- Bug on the loose, lets isolate it by davido
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |