I get it on my windows 2k machine with ActiveState perl 5.8.3
I don't get it on my linux machines. All of them have the same kernel and Perl build:
andromeda:davidj tmp > cat test.pl
#!/usr/bin/perl
#
use strict;
use warnings;
my $string = "abc";
while( $string =~ /b/g ) {
print $#-, "\n";
}
andromeda:davidj tmp > ./test.pl
0
andromeda:davidj tmp > uname -a
Linux andromeda 2.6.11-gentoo-r5 #3 Sun Apr 24 03:22:46 MDT 2005 i686
+Intel(R) Pentium(R) M processor 1.60GHz GenuineIntel GNU/Linuxandrome
+da:davidj tmp > perl -V
Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
Platform:
osname=linux, osvers=2.6.9-gentoo-r1, archname=i686-linux
uname='linux livecd 2.6.9-gentoo-r1 #1 smp thu nov 25 03:43:53 utc
+ 2004 i686 intel(r) pentium(r) m processor 1.60ghz genuineintel gnuli
+nux '
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.