File Coverage

blib/lib/Filter/Trigraph.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 9 9 100.0


line stmt bran cond sub pod time code
1             package Filter::Trigraph;
2 1     1   10967 use strict;
  1         2  
  1         172  
3             $Filter::Trigraph::VERSION = '0.02';
4              
5             my %tri = (
6             '=' => '#', '-' => '~', "'" => '^',
7             '(' => '[', ')' => ']', '!' => '|',
8             '<' => '{', '>' => '}', '/' => '\\',
9             );
10             my $tri = qr#\?\?([-='()<>!/])#;
11              
12 1     1   2556 use Filter::Simple sub{ s/$tri/$tri{$1}/go };
  1         53760  
  1         13  
  1         278  
13              
14             1;
15              
16             =head1 NAME
17              
18             Filter::Trigraph - understand ANSI C trigraphs in Perl source.
19              
20             =head1 SYNOPSIS
21              
22             use Filter::Trigraph;
23              
24             my $x = shift??!??!"testing";
25             if($ENV??)??<
26             ??= uppercase all vowels in $x
27             $x=??-s/(??(aeiou??))/??/u$1/g;
28             ??>else??<
29             ??= uppercase all non-vowels in $x
30             $x=??-s/(??(??'aeiou??))/??/u$1/g;
31             ??>
32             $??!=1;
33             print "$x??/n";
34              
35             =head1 DESCRIPTION
36              
37             Now that Perl supports Unicode, we should also support ISO 646-1983.
38              
39             ISO 646 is a character set very like ASCII, but with 9 of you favourite
40             characters removed.
41              
42             ANSI C supports this limited character set using a wonderful system
43             called "trigraphs" that replace the 9 missing essential characters with
44             sequences of two question marks and another symbol.
45              
46             Using this module you can now write Perl using only the characters found
47             in ISO 646.
48              
49             =head1 SEE ALSO
50              
51             Search for B in your local GNU C documentation.
52              
53             =head1 AUTHOR
54              
55             Marty Pauley Emarty@kasei.comE
56              
57             =head1 COPYRIGHT
58              
59             Copyright (C) 2001 Marty Pauley.
60              
61             This program is free software; you can redistribute it and/or modify it under
62             the terms of either:
63              
64             a) the GNU General Public License as published by the Free Software Foundation;
65             either version 2 of the License, or (at your option) any later version.
66             b) the Perl Artistic License.
67              
68             This program is distributed in the hope that it will be useful, but WITHOUT ANY
69             WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
70             PARTICULAR PURPOSE. See the GNU General Public License for more details.
71              
72             =cut