On Thursday, June 26, 2003, at 02:37 PM, Steve Grazzini wrote:
I've worked up an extension module to add "(?<name> ...)" patterns to Perl's regex language.
Ooh, awesome.
There's also a pragma to make the named groups available as implicitly-declared 'my' variables.
use Regexp::Capture; use strict;
while (<>) { use capture;
That seems a little strange to me - doesn't it require a capture.pm module? Could it be turned on & off by an exported Regexp::Capture function? Or maybe "use Regexp::Capture qw(lexicals);"?
The XS loads patched versions of regcomp/regexec, which the core calls via-function-pointer. C<re 'debug'> does the same thing (and I think this is less subversive than source filters :-) but it probably still needs some kind of "CAVEAT".
How dire should the warning be? "Experimental?" "ACME?"
I'd just have an '=head1 CAVEATS' section and explain the current implementation. It doesn't sound too voodooish to me. I was actually pleasantly surprised to find out you *hadn't* used source filters. =)
And can anybody suggest a better name/namespace?
Regexp::NamedCapture would be a little more explicit. Definitely something in Regexp::.
-Ken
