line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Lingua::YaTeA::XMLEntities; |
4
|
5
|
|
|
5
|
|
35
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
143
|
|
5
|
5
|
|
|
5
|
|
60
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
1317
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub encode |
10
|
|
|
|
|
|
|
{ |
11
|
736
|
|
|
736
|
1
|
1250
|
$_[0]=~s/&/&/go; |
12
|
736
|
|
|
|
|
1034
|
$_[0]=~s/\"/"/go; |
13
|
736
|
|
|
|
|
1026
|
$_[0]=~s/\'/'/go; |
14
|
736
|
|
|
|
|
1059
|
$_[0]=~s/</go; |
15
|
736
|
|
|
|
|
1106
|
$_[0]=~s/>/>/go; |
16
|
|
|
|
|
|
|
|
17
|
736
|
|
|
|
|
1055
|
return($_[0]); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head2 decode($line) |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
This method decodes XML entities corresponding to special XML characters in the line C<$line> . |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub decode |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
0
|
1
|
|
$_[0]=~s/"/\"/go; |
31
|
0
|
|
|
|
|
|
$_[0]=~s/'/\'/go; |
32
|
0
|
|
|
|
|
|
$_[0]=~s/&/&/go; |
33
|
0
|
|
|
|
|
|
$_[0]=~s/</
|
34
|
0
|
|
|
|
|
|
$_[0]=~s/>/>/go; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
return($_[0]); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |