22
33use strict;
44use warnings;
5- use autodie qw( :all ) ;
65
76use FindBin qw( $Bin ) ;
87
@@ -54,7 +53,7 @@ sub _make_man {
5453 ' -M' , " section:$section " ,
5554 $input ,
5655 ' -o' , $output ,
57- );
56+ ) == 0 or die " Failed to run pandoc: $! " ;
5857 _pandoc_postprocess($output );
5958 }
6059 elsif ( $translator eq ' lowdown' ) {
@@ -67,7 +66,7 @@ sub _make_man {
6766 ' -M' , " section:$section " ,
6867 $input ,
6968 ' -o' , $output ,
70- );
69+ ) == 0 or die " Failed to run lowdown: $! " ;
7170 }
7271}
7372
@@ -76,9 +75,11 @@ sub _make_lib_man_links {
7675
7776 my $header = read_file(" $Bin /../include/maxminddb.h" );
7877 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: $! " ;
8283 }
8384}
8485
@@ -92,7 +93,7 @@ sub _pandoc_postprocess {
9293 s / ^\. IP\n\. nf/ .IP "" 4\n .nf/ gm ;
9394 s / (Automatically generated by Pandoc)(.+)$/ $1 / m ;
9495 },
95- $file
96+ $file ,
9697 );
9798}
9899
0 commit comments