Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
is not consistent with this behavior:my $s=',,,,'; @nCommas=($s=~/,/g); $nCommas=@nCommas; print "$nCommas\n"; # prints 4
Why isn't $nCommas equal to 4 in the second example? Thanks!my $s=',,,,'; $nCommas=($s=~/,/g); print "$nCommas\n"; # prints 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: context conversions: seeking enlightenment
by Anonymous Monk on Apr 18, 2002 at 19:57 UTC | |
by tye (Sage) on Apr 18, 2002 at 20:47 UTC |