in reply to Re^2: Is there a module for object-oriented substring handling/substitution?
in thread Is there a module for object-oriented substring handling/substitution?
Much like a DOM-tree, you could traverse it for whatever markup-element ("table") you want.
Parse the wiki-page into a tree, manipulate the tree and rebuild the page again.
Otherwise:
If you insist to stick persistent meta-informations to ranges of characters, then you should better work with arrays of characters. You could tie or bless the scalar elements with whatever info you want. If your user inserts or deletes anything from the array your metainfos will move accordingly.
And if you wanna go the full "emacs way" you need to realize linked lists. The easiest way is having 2 element arrays [$value,$successor_ref]
EDIT:
After some meditation, IMHO if you need full interactivity, better stay with the AoH with the document tree, and a "cursor" pointing to the current element. Whenever the user does insert characters update the tree at the point the cursor points to.
You'll also need to store informations like "parent", "child", "nextSibling" ...
Have a look at DOM or XML modules at CPAN for inspiration.
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Is there a module for object-oriented substring handling/substitution?
by smls (Friar) on Jan 26, 2013 at 21:54 UTC | |
by LanX (Saint) on Jan 26, 2013 at 22:08 UTC | |
by smls (Friar) on Jan 26, 2013 at 22:38 UTC | |
by Anonymous Monk on Jan 28, 2013 at 09:28 UTC |