D_RE $SYSV_SUPPORTED $SEMOP_ARGS @EXPORT_OK %EXPORT_TAGS $N $SHEM_REPO );
use Config;
use JSON ();
use Scalar::Util ();
use constant SHM_BUFSIZ => 65536;
use constant SEM_LOCK
buffer, 0, 1 );
my $j = JSON->new->utf8->relaxed->allow_nonref;
my $data;
local $@;
# try-catch
eval
{
# Does the value have any typical json format? " for a string, {
data = $buffer;
}
};
if( $@ )
{
$self->error( "An error occured while json decoding data: $@", ( length( $buffer ) <= 1024 ? "\nData is: '$buffer'" : '' ) );
# Mayb
use Digest::MD5;
use File::Basename ();
use File::Spec ();
use IO::File;
use JSON;
use Scalar::Util ();
use URI::file;
our $VERSION = 'v0.1.3';
# Translation of ty
my $load_json_data = sub
{
my $json_file = shift( @_ ) || return;
my $io = IO::File->new( "<$json_file" ) ||
return( $self->error( "Unable to open our own json magic fi
>close;
local $@;
# try-catch
my $rv = eval
{
my $j = JSON->new->relaxed->allow_nonref;
$MAGIC_DATA = $self->{magic_data} = $j->decode( $buf );
}
The content is stored in shared memory as L<JSON> encoded, but since it is shared, L<read> do some minimal check to see if the data looks like JSON data. It it does not, the data is returned as-i
vided to the shared memory.
When doing so, this will encode the data as L<JSON> text data. It supports data supported by JSON, so basically string, hash reference and array reference.
It returns the
ining, or under if there was an error, which can then be retrieved with L<Module::Generic/error>
JSON data are more portable across network and is a widely used technology.
=head1 AUTHOR
Jacques De