Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Perl6::Rules Capturing

by saintmike (Vicar)
on Oct 10, 2004 at 16:21 UTC ( #398006=perlquestion: print w/replies, xml ) Need Help??
saintmike has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks, I must be doing something incredibly stupid to prevent this simple script from working:
use Perl6::Rules; grammar Foo { rule number { (\d+) { print "Found '$1'\n"; } } } "123" =~ m/<Foo.number>/;
Can you see why it doesn't capture the number but leaves $1 undef'd? Any help apprechiated.

Replies are listed 'Best First'.
Re: Perl6::Rules Capturing
by tilly (Archbishop) on Oct 12, 2004 at 06:03 UTC
    I would guess that Perl6::Rules is not properly installed. It is a complex and highly experimental module with dependencies that I do not understand.

    When you installed it, did you run the test suite? (The make test step.) When I tried that, I had a ton of failures, castaway did likewise. I forced an install of the module, and your script produced the same result for me that it did for you. From the documentation, the script clearly should work.

    Therefore I'm guessing that if you tried it, it would fail the test suite. If running the module matters to you, you should look at the failures, start running the tests individually, and see if you can track down what fails. For those who are interested, I below is a summary of my test failures, and I'll mention this thread to TheDamian (who may or may not have the time/energy needed to do anything about it):

Re: Perl6::Rules Capturing
by TheDamian (Priest) on Oct 13, 2004 at 00:18 UTC
    There are known problems with Perl6::Rules under perl 5.8.4 and later. I.e. some features of the module don't work properly any more. Since Perl6::Rules came out (and worked) under 5.8.3, the valiant Perl 5 porters have started fixing some very deep problems that the module had exposed in the core regex engine, specifically problems in the way that closures embedded in regexes (don't) work.

    The regex engine has been a moving target since then, and probably will be for some time yet, so I've held off reworking Perl6::Rules until I can genuinely fix it.

    And, of course, CTDS (Chronic Tuit Deficiency Syndrome) hasn't helped either. :-(

    I'm certainly not happy about the current situation, and I apologize for the unsatisfactory state of the module, but I'm afraid there isn't anything I can do about it in the immediate future.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://398006]
Approved by davido
Front-paged by Arunbear
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-04-28 14:28 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (524 votes). Check out past polls.