empfile );
use File::Copy qw(cp);
use Getopt::Long qw(:config no_ignore_case );
use JSON qw( encode_json decode_json );
use List::Util qw( pairs );
use Log::Log4perl qw( :easy );
use Log::Log4perl::Le
######################################
goto &get_json_file;
}
########################################################################
sub get_json_file {
##########################################
##################
my ($file) = @_;
my ($json) = process_file(
$file,
- chomp => 1,
merge_lines => 1
);
return decode_json($json);
}
########################################
##############
require IO::Scalar;
require Data::Dumper;
require JSON;
require Text::CSV_XS;
JSON->import('decode_json');
Data::Dumper->import('Dumper');
# +------------------+
# |
--------+
# | READ A JSON FILE |
# +------------------+
my $json_text = <<'END_OF_TEXT';
{
"foo" : "bar",
"baz" : "buz"
}
END_OF_TEXT
$fh = IO::Scalar->new( \$json_text );
print Dump
post(@_);
return decode_json( join $EMPTY, @{ $_[1] } );
}
)
);
$fh = IO::Scalar->new( \$json_text );
print Dumper( decode_json( process_file( $fh, merge_lines => 1,