NAME
Data::Properties::JSON - JSON test fixtures and properties.
SYNOPSIS
File /path/to/file.json
{
"contact_form": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@test.com",
"message": "This is a test message...just a test."
}
}
Your Perl code:
use Data::Properties::JSON;
my $props = Data::Properties::JSON->new(
properties_file => "/path/to/file.json"
);
-- or --
my $props = Data::Properties::JSON->new( json => $json_string );
-- or --
my $props = Data::Properties::JSON->new( data => { foo => "bar" } );
$props->contact_form->first_name; # John
$props->contact_form->last_name; # Doe
$props->contact_form->email; # john.doe@test.com
# Works differently depending on the calling context:
my %hash = $props->contact_form->as_hash;
my $hashref = $props->contact_form->as_hash;
AUTHOR and Copyright
Copyright 2011 John Drago <jdrago_999@yahoo.com> all rights reserved.
LICENSE
This software is Free software and may be used and redistributed under the same terms as any version of perl itself.