SHARYANTO::Data::Util - Data utilities
version 0.57
None are exported by default, but they are exportable.
For example, this data:
$x = [1]; $data = [$x, 2, $x];
contains circular references by referring to $x twice. After clone_circular_refs, data will become:
$x
clone_circular_refs
$data = [$x, 2, [1]];
that is, the subsequent circular references will be deep-copied. This makes it safe to transport to JSON, for example.
Sometimes it doesn't work, for example:
$data = [1]; push @$data, $data;
Cloning will still create circular references.
This function modifies the data structure in-place, and return true for success and false upon failure.
Arguments ('*' denotes required arguments):
data* => any
Return value:
Does not deal with weak references.
SHARYANTO
Data::Structure::Util has the XS/C version of has_circular_ref which is 3 times or more faster than this module's implementation which is pure Perl). Use that instead if possible (in some cases, Data::Structure::Util fails to build and this module provides an alternative for that function).
has_circular_ref
This module is however much faster than Devel::Cycle.
Please visit the project's homepage at https://metacpan.org/release/SHARYANTO-Data-Util.
Source repository is at https://github.com/sharyanto/perl-SHARYANTO-Data-Util.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=SHARYANTO-Data-Util
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2013 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install SHARYANTO::Data::Util, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SHARYANTO::Data::Util
CPAN shell
perl -MCPAN -e shell install SHARYANTO::Data::Util
For more information on module installation, please visit the detailed CPAN module installation guide.