I get the following error when I try to use <ALIAS=\IDENT> in Regexp::Grammars. I can't see what is wrong with my code (str_delim is not misspelled). Could anybody let me know what is wrong?
~/linux/test/perl/library/Regexp/Grammars/</=/\$ cat main.pl #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my $grammar = do { use Regexp::Grammars; qr{ (?#<logfile:->) <delimited_string> <token: delimited_string> <ldelim=str_delim> .*? <rdelim=\ldelim> <token: str_delim> ["'`] }xms; }; my $string = "''"; if ($string =~ $grammar) { print Dumper \%/; } ~/linux/test/perl/library/Regexp/Grammars/</=/\$ ./main.pl error | Found call to <ldelim=str_delim>, but no <rule: str_delim> or | <token: str_delim> was defined in the grammar | (Did you misspell the rule name or forget to define the rule? +) | error | Found call to <______0_88_str_delim>, but no <rule: ______0_8 +8_str_delim> or | <token: ______0_88_str_delim> was defined in the grammar | (Did you misspell the rule name or forget to define the rule? +) | error | Found call to <str_delim>, but no <rule: str_delim> or | <token: str_delim> was defined in the grammar | (Did you misspell the rule name or forget to define the rule? +) | warn | Possible invalid subrule call: | <ldelim=str_delim> | (To silence this warning, use: \<ldelim=str_delim> | warn | Possible invalid subrule call: | <rdelim=(?{; *Regexp::Grammars::LOGFILE | (To silence this warning, use: \<rdelim=(?{; *Regexp::Grammar +s::LOGFILE | warn | Possible invalid subrule call: | <______0_88_str_delim> | (To silence this warning, use: \<______0_88_str_delim> | warn | Possible invalid subrule call: | <str_delim> | (To silence this warning, use: \<str_delim> | Eval-group not allowed at runtime, use re 'eval' in regex m/(?{; *Rege +xp::Grammars::LOGFILE = Regexp::Grammars::_open_log('>>','-'); })((? +{; @! = () if !.../ at ./main.pl line 10.

In reply to The usage of <ALIAS=\IDENT> of Regexp::Grammars by 0FGVYqxHQZ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.