in reply to overload =~ operator

Perhaps you might have more luck with Class::Trait. I realize this has nothing to do with regular expressions, but if you're trying to solve the problem I think you're trying to solve, try this.

If that's not the problem you're trying to solve, please clarify.

Replies are listed 'Best First'.
Re^2: overload =~ operator
by dk (Chaplain) on Sep 28, 2006 at 07:49 UTC
    Eh well, it seems that I shouldn't have mentioned the word 'class' at all, because the problem I'm trying to solve has little to do with classes: I've implemented a very simple two-dimensional regex engine, which can now be called with the ugly syntax

    match2('\v1(\h2(\v3(\h4)))', ['13', '24'])

    but I want it to look like

    ['13','24'] =~ m2/\v1(\h2(\v3(\h4)))/

    sure I could wait until 5.10 and the use feature ~~ but I'd rather overload =~ now.