in reply to Re^3: Communication of program(s) with regex codeblocks
in thread Communication of program(s) with regex codeblocks

My 'specification' was incomplete, and I apologise for that. I will give some context to make clear what I am trying to figure out.

Ultimate goal: extracting information from a wide variety of text files, representing published articles.

With a largish set of text files, most of them needing their own set of regexes (to split them into usable parts), it would seem to make sense to store regexfile with textfile. I foresee that a lot of strings thus extracted will subsequently (to get that final info-nugget for my database) need unique code. It would make sense to also keep such code associated with the textfile. For this, the codeblocks are one candidate, modules are another, snippet files for future eval yet another.

(a concrete example of the textbase: from one author all published articles, 600 text files, ranging from 1 page to 100+ pages, published over a period of 40 years in several journals.)

So there is the context in which I am trying to find out how 'heavy' those regex codeblocks can be 'loaded' with code, and what communication/steering/instrumentation can be dreamed up. I initially hoped that DBI searches would be possible. This turns out to be almost certainly impossible/unwise, because absolutely no regex can be used inside a codeblock. But I believe subroutines and closures can be defined and called.

So what I'm trying is to logically split very 'specific' code over a text-centric system with many disparate textfiles. It may be a Bad Thing - I am not advocating it, but hope to gain from experience of others on similar exploits.

  • Comment on Re^4: Communication of program(s) with regex codeblocks - (explaining ultimate goal)

Replies are listed 'Best First'.
Re^5: Communication of program(s) with regex codeblocks
by ikegami (Patriarch) on Oct 28, 2004 at 22:33 UTC

    Are you saying you're planning on writting a regexp for every file?

    • If so, you could include a code block at the top, and seperate it from the data with __DATA__. Then the code block can process the data using <DATA>. (See my post further up this thread for an example on how to use __DATA__.)
    • If not, I don't see why your program has to be in a regexp instead of the other way around.