in reply to Efficient walk/iterate along a string
Perl is a tool that handles complicated string manipulations well, but it's not designed to handle individual characters near so well. For that you need something closer to the silicon like C. However, on a case by case basis it may be that you don't need to handle individual characters and instead can use index or a regex to do much of the heavy lifting. The alternative may be to invest the time in writing an XS module that provides an iterator to efficiently traverse a string returning a character at a time and providing the current index on demand.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Efficient walk/iterate along a string
by DrHyde (Prior) on Nov 23, 2010 at 10:22 UTC | |
by Anonymous Monk on Nov 23, 2010 at 10:49 UTC | |
by GrandFather (Saint) on Nov 23, 2010 at 19:35 UTC |