in reply to XML::Twig questions

Let me try to clarify the overall view of what I'm trying to do. I have a GUI interface written in AHK (www.autohotkey.com), where users can select a category (node) to search by, and enter a search value. They hit go, and the Perl script is called with two arguments, the node to search and the value to look for. The cmd console window is suppressed, and the content that would be written to STDOUT is piped to an edit control in the GUI. The user is able to stop the script if a match is found by effectively killing the perl.exe Windows process.

Is XML::Twig even the best approach for this problem? I want this to run quickly and not use a ton of system resources.

Replies are listed 'Best First'.
Re^2: XML::Twig questions
by Jenda (Abbot) on Aug 31, 2008 at 15:24 UTC

    In that case importing the data into a database (most likely DBD::SQLite would be enough), adding a few indexes and searching there would be both quickest and easiest. And if you do need the data in XML format you can export the records you find that way fairly easily.

    Otherwise you end up parsing and reparsing the file over and over again which will be slow.