This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: \N{...} in regular expression [PATCH]
[perl5.git] / t / lib / Cname.pm
1 package Cname;
2 our $Evil='A';
3
4 sub translator {
5     my $str = shift;
6     if ( $str eq 'EVIL' ) {
7         (my $c=substr("A".$Evil,-1))++;
8         my $r=$Evil;
9         $Evil.=$c;
10         return $r;
11     }
12     if ( $str eq 'EMPTY-STR') {
13        return "";
14     }
15     return $str;
16 }
17
18 sub import {
19     shift;
20     $^H{charnames} = \&translator;
21 }
22 1;