Group
Extension

Matches 1

JSON-Ordered-Conditional ( L/LN/LNATION/JSON-Ordered-Conditional-0.03.tar.gz, LNATION, 2025; MetaCPAN )
JSON-Ordered-Conditional/lib/JSON/Ordered/Conditional.pm ( view source; MetaCPAN )
ge JSON::Ordered::Conditional;

use 5.006; use strict; use warnings; our $VERSION = '0.03';
use JSON::MultiValueOrdered; use base 'Struct::Conditional';

use Tie::IxHash;

our $JSON;

BEGIN {
	$JSON =
N::MultiValueOrdered->new;
}

sub encode {
	if ($_[2]) {
		$_[0]->encode_file($_[1], $_[2]);
	}
	$JSON->encode($_[1]);
}

sub encode_file {
	open my $file, '>', $_[2] or die "cannot open file $!";
	pr
ile;
}

sub decode {
	if ( $_[1] !~ m/\n/ && -f $_[1]) {
		return $_[0]->decode_file($_[1]);
	}
	$JSON->decode($_[1]);
}

sub decode_file {
	open my $file, '<', $_[1] or die "cannot open file $!";
	my

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.