Nile::Serializer - Data structures Serializer
$data = {fname=>"ahmed", lname=>"elsheshtawy", phone=>{mobile=>"012222333", home=>"02222444"}}; $encoded = $app->freeze->json($data); $encoded = $app->freeze->yaml($data); $encoded = $app->freeze->storable($data); $encoded = $app->freeze->dumper($data); $encoded = $app->freeze->xml($data); # also serialize method is an alias for freeze $encoded = $app->serialize->json($data);
$data = {fname=>"ahmed", lname=>"elsheshtawy", phone=>{mobile=>"012222333", home=>"02222444"}}; $encoded = $app->freeze->json($data); # returns: # {"lname":"elsheshtawy","fname":"ahmed","phone":{"home":"02222444","mobile":"012222333"}}
Serialize a data structure to a JSON structure.
$data = {fname=>"ahmed", lname=>"elsheshtawy", phone=>{mobile=>"012222333", home=>"02222444"}}; $encoded = $app->freeze->yaml($data); # returns: # --- # fname: ahmed # lname: elsheshtawy # phone: # home: 02222444 # mobile: 012222333
Serialize a data structure to a YAML structure.
$data = {fname=>"ahmed", lname=>"elsheshtawy", phone=>{mobile=>"012222333", home=>"02222444"}}; $encoded = $app->freeze->storable($data); # returns: binary data
Serialize a data structure to a Storable structure.
$data = {fname=>"ahmed", lname=>"elsheshtawy", phone=>{mobile=>"012222333", home=>"02222444"}}; $encoded = $app->freeze->dumper($data); # returns: # $M = {'lname' => 'elsheshtawy','fname' => 'ahmed','phone' => {'home' => '02222444','mobile' => '012222333'}};
Serialize a data structure to a Data::Dumper structure.
$data = {fname=>"ahmed", lname=>"elsheshtawy", phone=>{mobile=>"012222333", home=>"02222444"}}; $encoded = $app->freeze->xml($data); # returns: # <?xml version="1.0" encoding="UTF-8" ?> # <fname>ahmed</fname> # <lname>elsheshtawy</lname> # <phone> # <home>02222444</home> # <mobile>012222333</mobile> # </phone>
Serialize a data structure to a XML structure.
This project is available on github at https://github.com/mewsoft/Nile.
Please visit the project's homepage at https://metacpan.org/release/Nile.
Source repository is at https://github.com/mewsoft/Nile.
See Nile for details about the complete framework.
Ahmed Amin Elsheshtawy, احمد امين الششتاوى <mewsoft@cpan.org> Website: http://www.mewsoft.com
Copyright (C) 2014-2015 by Dr. Ahmed Amin Elsheshtawy احمد امين الششتاوى mewsoft@cpan.org, support@mewsoft.com, https://github.com/mewsoft/Nile, http://www.mewsoft.com
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Nile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Nile
CPAN shell
perl -MCPAN -e shell install Nile
For more information on module installation, please visit the detailed CPAN module installation guide.