cruftectomy has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use charnames ':full'; use Parse::RecDescent; $::RD_TRACE = 1; $::RD_HINT = 1; my $parser = new Parse::RecDescent(<<'EOG') || die; ex1: "\N{DIAMOND OPERATOR}" {warn 'got it'} # fails despite 'use char +names' ex2: "\x{22c4}" {warn 'got it'} # always works ex3: /\p{Letter}/ {warn 'got letter'} # fails unless 'use charnames.. +.' EOG
The hint offered by the parser states 'Constant(\N{...}): $^H{charnames} is not defined'.
It's interesting to note that the line 'ex3' fails if charnames isn't used, so P::RD seems to sort-of know about about charnames.
Alternatively, if anyone has dealt with unicode in P::RD grammars, I'd like to hear your opinions and experiences (hopefully not too grim).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse::RecDescent and unicode
by ikegami (Patriarch) on Sep 14, 2005 at 17:05 UTC |