Data::Properties::JSON - JSON test fixtures and properties.
This module is now deprecated and should no longer be used.
File /path/to/file.json
/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;
Copyright 2011 John Drago <jdrago_999@yahoo.com> all rights reserved.
This software is Free software and may be used and redistributed under the same terms as any version of perl itself.
JSON and JSON::XS
ASP4
To install Data::Properties::JSON, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Properties::JSON
CPAN shell
perl -MCPAN -e shell install Data::Properties::JSON
For more information on module installation, please visit the detailed CPAN module installation guide.