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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl is returning... odd results... from regular expressions. Things matching when they shouldn't, and stuff like that.
by Groxx (Novice) on Jan 11, 2007 at 08:01 UTC | |
by Groxx (Novice) on Jan 11, 2007 at 08:36 UTC | |
by ikegami (Patriarch) on Jan 11, 2007 at 20:30 UTC |