pairs);
use Scalar::Util qw(reftype);
use Log::Log4perl qw(:easy);
use Log::Log4perl::Level;
use JSON;
use Template;
use YAML qw(Load LoadFile DumpFile);
use parent qw(Exporter);
our @EXPORT_OK = q
le, %options ) = @_;
my $type = lc( $options{type} // $EMPTY );
if ( any { $type eq $_ } qw(json yaml dmp) ) {
$options{comments} = $FALSE;
}
$options{comments} //= $TRUE; # leave comme
ents} ) {
while ( $content =~ s/^[\#][^\n]*$//gxsm ) { }
}
return decode_json($content)
if $type eq 'json';
return Load($content)
if $type eq 'yaml';
return eval "$content" ## n