in reply to Re: Re: Regexp::Common inside Parse::RecDescent
in thread Regexp::Common inside Parse::RecDescent
I suggest using here-docs for grammars.
#!perl use warnings; use strict; my $one = q{/\d \\ \/ \\/ / }; my $two = <<'--snip--'; /\d \\ \/ \\/ / --snip-- print "\$one is `$one'\n\$two is `$two'\n"; __END__
This prints
which means you needn't escape your backslashes in single-quote here-docs. This can make regexes more readable.$one is `/\d \ \/ \/ / ' $two is `/\d \\ \/ \\/ / '
|
|---|