Data::Crumbr::Util - utility functions for Data::Crumbr
version 0.1.1
Utility functions for Data::Crumbr.
my $encoder = id_encoder();
trivial encoding function that just returns its first argument (i.e. no real encoding is performed).
my $encoder = json_leaf_encoder();
encoding function that returns a JSON-compliant value, only for leaf values. It works on:
plain strings, returned after JSON encoding (e.g. tranformation of newlines, etc.)
empty array references, in which case string [] is returned
[]
empty hash references, in which case string {} is returned
{}
null values, in which case string null is returned
null
my $encoder = uri_encoder();
encoding function that then encodes strings according to URI encoding (i.e. percent-encoding).
Flavio Poletti <polettix@cpan.org>
Copyright (C) 2015 by Flavio Poletti <polettix@cpan.org>
This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install Data::Crumbr, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Crumbr
CPAN shell
perl -MCPAN -e shell install Data::Crumbr
For more information on module installation, please visit the detailed CPAN module installation guide.