use strict; use warnings; use Parse::RecDescent (); #$::RD_TRACE = 1; $::RD_HINT = 1; my $parser = new Parse::RecDescent(<<'EOG') || die; { # Put pragmas, modules and functions # used by the parser in these curlies. use strict; use warnings; use charnames ':full'; } ex1: "\N{DIAMOND OPERATOR}" ex2: "\x{22c4}" ex3: /\p{Letter}/ EOG my $text = chr(0x22C4); print("$_: ", $parser->$_($text) ? "match" : "no match", "\n") foreach qw( ex1 ex2 ex3 ); __END__ output ====== ex1: match ex2: match ex3: no match