in reply to regex-codeblock calling subroutines?

Hmm. Point(s) taken (to both david and capt). Thanks.

I must admit that I am not sure if it will be a good idea, or even work at all. I was hoping to find monks who stumbled along the same path, and came out victorious or beaten, but wiser.

It seems an attractive idea to have some db-backed 'directive' when crafting a regex.

I'll just stumble on for a bit.

(erix is 'Anonymous Monk' - lost cookie when I posted that initial question)

  • Comment on Re: regex-codeblock calling subroutines?

Replies are listed 'Best First'.
Re^2: regex-codeblock calling subroutines?
by diotalevi (Canon) on Oct 15, 2004 at 19:23 UTC

    No really, don't.

    Any code you call from inside a (?{ ... }) absolutely, cannot use regular expressions at all. Unless you control every part of the code being run inside the expression, the code isn't safe. I expect that you're using DBI and a driver module to work with your database. That's all code that you don't control and that probably uses regular expressions. None of that can be called from within a (?{ ... }) block.

    Examine the pre-forking used in Regexp::Approx - Use fuzzy regular expressions to see how I fork during INIT and then run the unsafe code in a separate process. This is the only general method which allows you to do this sort of thing.

      Right, that settles it then. I did not realise the regex-inside-block aspect. I'll scurry back then, instead of stumbling on. And I will have a look at that module.

      Thanks, Eric