This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make MM_VMS::oneline build continuation lines properly.
[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         # Returns A first time, AB second, ABC third ... A-ZA the 27th time.
8         (my $c=substr("A".$Evil,-1))++;
9         my $r=$Evil;
10         $Evil.=$c;
11         return $r;
12     }
13     if ( $str eq 'EMPTY-STR') {
14        return "";
15     }
16     if ( $str eq 'NULL') {
17         return "\0";
18     }
19     if ( $str eq 'LONG-STR') {
20         return 'A' x 255;
21     }
22     # Should exceed limit for regex \N bytes in a sequence.  Anyway it will if
23     # UCHAR_MAX is 255.
24     if ( $str eq 'TOO-LONG-STR') {
25        return 'A' x 256;
26     }
27     return $str;
28 }
29
30 sub import {
31     shift;
32     $^H{charnames} = \&translator;
33 }
34 1;