There's no comma leading the data, but it matches anyway... how?
What makes you think it matched? In the code you presented, m/^,/ is evaluated, then its value is discarded, then $i is evaluated, and its value is used to determine whether to enter the if or not. Since $i is true, the if is entered.
Where you trying to do the following?
my $j=0; if ($i =~ m/^,/){ print $j++ . ": " . $i . "\n"; }
In reply to Re: Perl is returning... odd results... from regular expressions. Things matching when they shouldn't, and stuff like that.
by ikegami
in thread Perl is returning... odd results... from regular expressions. Things matching when they shouldn't, and stuff like that.
by Groxx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |