line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::optex::textconv::pandoc; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.1401'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
888
|
use v5.14; |
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
7
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
6
|
use App::optex::textconv::Converter 'import'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @CONVERTER = ( |
12
|
|
|
|
|
|
|
[ qr/\.doc[xm]$/ => \&to_text ], |
13
|
|
|
|
|
|
|
[ qr/\.ppt[xm]$/ => \&to_text ], |
14
|
|
|
|
|
|
|
[ qr/\.xls[xm]$/ => \&to_text ], |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub to_text { |
18
|
0
|
|
|
0
|
0
|
|
my $file = shift; |
19
|
0
|
|
|
|
|
|
my $format = q(pandoc -t plain "%s"); |
20
|
0
|
|
|
|
|
|
my $exec = sprintf $format, $file; |
21
|
0
|
|
|
|
|
|
qx($exec); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |