in reply to using foreach with a regex
i want to know how i can use "foreach" Loop in this situation instead of the "for" loopfor and foreach are exact synonyms, so whenever you can one, you can also use the other instead.
But maybe it's easier to use while ($string =~ /regex/g) { ... } instead of the combination of for and </c> (unless you want to limit the number of possible matches).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using foreach with a regex
by ikegami (Patriarch) on Dec 05, 2008 at 15:50 UTC | |
by JadeNB (Chaplain) on Dec 05, 2008 at 16:36 UTC | |
by JavaFan (Canon) on Dec 05, 2008 at 16:55 UTC |