Introduce config support, rename fortune.pm to easter_egg.pm
This commit is contained in:
19
myapi-confcheck.pl
Executable file
19
myapi-confcheck.pl
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings "all";
|
||||
|
||||
use JSON::PP;
|
||||
|
||||
my $conf = "data/myapi.json";
|
||||
my $jstr = "";
|
||||
my $sep = $/;
|
||||
$/ = '';
|
||||
open (C, $conf) || die "No such file $conf\n";
|
||||
$jstr = <C>;
|
||||
close C;
|
||||
|
||||
my $c = decode_json($jstr);
|
||||
|
||||
my $j = JSON::PP->new->pretty->canonical->indent_length(4);
|
||||
print $j->encode($c);
|
||||
Reference in New Issue
Block a user