Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brummett/data-transform-explicitmetadata
Transform a Perl data structure into one with explicit metadata
https://github.com/brummett/data-transform-explicitmetadata
Last synced: 1 day ago
JSON representation
Transform a Perl data structure into one with explicit metadata
- Host: GitHub
- URL: https://github.com/brummett/data-transform-explicitmetadata
- Owner: brummett
- Created: 2014-03-08T22:43:06.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-10-26T19:51:34.000Z (about 5 years ago)
- Last Synced: 2024-11-06T07:28:25.189Z (about 2 months ago)
- Language: Perl
- Size: 68.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/brummett/Data-Transform-ExplicitMetadata.png?branch=master)](https://travis-ci.org/brummett/Data-Transform-ExplicitMetadata)
## Data::Transform::ExplicitMetadataTransform a Perl data structure into one with basic data types and
explicit metadata. This data structure can be safely JSON encoded.## Description
The JSON module can only encode Perl data structures directly representable
as JSON strings: simple scalars, arrayrefs and hashrefs.This module transforms a perl data structure into one which may safely
be JSON encoded, while maintaining Perl-specific metadata that isn't directly
expressable in JSON such as blessed and tied references, self-referential
data, typeglobs, reference addresses, etc.When destrializing, it recreates the original data as closely as possible.
It also includes a Javascript library to manipulate the data structure
created from the JSON string.## Usage
use Data::Transform::ExplicitMetadata;
use JSON;
my $encoded = Data::Transform::ExplicitMetadata::encode($perl_data);
my $json_string = JSON::encode_json($encoded);my $perl_copy = Data::Transform::ExplicitMetadata::decode($encoded);