2
2
3
3
use strict;
4
4
use warnings;
5
- use autodie qw( :all ) ;
6
5
7
6
use FindBin qw( $Bin ) ;
8
7
@@ -54,7 +53,7 @@ sub _make_man {
54
53
' -M' , " section:$section " ,
55
54
$input ,
56
55
' -o' , $output ,
57
- );
56
+ ) == 0 or die " Failed to run pandoc: $! " ;
58
57
_pandoc_postprocess($output );
59
58
}
60
59
elsif ( $translator eq ' lowdown' ) {
@@ -67,7 +66,7 @@ sub _make_man {
67
66
' -M' , " section:$section " ,
68
67
$input ,
69
68
' -o' , $output ,
70
- );
69
+ ) == 0 or die " Failed to run lowdown: $! " ;
71
70
}
72
71
}
73
72
@@ -76,9 +75,11 @@ sub _make_lib_man_links {
76
75
77
76
my $header = read_file(" $Bin /../include/maxminddb.h" );
78
77
for my $proto ( $header =~ / ^ *extern.+?(MMDB_\w +)\( /gsm ) {
79
- open my $fh , ' >' , " $target /man/man3/$proto .3" ;
80
- print {$fh } " .so man3/libmaxminddb.3\n " ;
81
- close $fh ;
78
+ open my $fh , ' >' , " $target /man/man3/$proto .3"
79
+ or die " Failed to open file: $! " ;
80
+ print {$fh } " .so man3/libmaxminddb.3\n "
81
+ or die " Failed to write to file: $! " ;
82
+ close $fh or die " Failed to close file: $! " ;
82
83
}
83
84
}
84
85
@@ -92,7 +93,7 @@ sub _pandoc_postprocess {
92
93
s / ^\. IP\n\. nf/ .IP "" 4\n .nf/ gm ;
93
94
s / (Automatically generated by Pandoc)(.+)$/ $1 / m ;
94
95
},
95
- $file
96
+ $file ,
96
97
);
97
98
}
98
99
0 commit comments