projects
/
p5sagit/p5-mst-13.2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Re: Named-capture regex syntax
[p5sagit/p5-mst-13.2.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;