Data::Undump - Perl extension for securely and quickly deserializing simple Data::Dumper dumps
use Data::Undump qw(undump); my $dump= Data::Dumper->new([$simple_thing])->Terse(1)->Dump(); undump($dump);
Securely and quickly deserialize simple Data::Dumper dumps.
Note that this is an early release. Please contact the author(s) if you intend to use this software in production.
By default exports the undump subroutine.
undump
Undumps a Data::Dumper style data structure. Takes a plain string (magic not currently respected) containing a Data::Dumper Terse/Deepcopy style Dumper output (ie. no $VAR1 = at the front allowed currently) and returns either undef for a failed parse, or a scalar value of the value parsed. Also, in case of a failed parse, an error message will be available in the $@ variable.
Dumper
$VAR1 =
$@
Restricted to objects nested up to 100 items deep.
Support for the following isn't implemented but might be in future enhancements.
* String magic on input scalar * qr// * ref to object. Eg \['foo'] * Make it possible to parse a list instead of a scalar. * Blessed objects? * Cyclic structures? * Less/more tolerant parsing rules? * Filters? (Block things by their position in the structure?) * Conversion? (IE, we have '[1,1,1]' in the input, and we know we wont * need it so parse it as '1,1,1' instead.
Data::Dumper, eval
Yves Orton <demerphq@gmail.com>
with contributions by:
Steffen Mueller <smueller@cpan.org> Rafael Garcia-Suarez <rgs@consttype.org>
Copyright (C) 2012 by Yves Orton
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
A git repository for this distribution can be found at https://github.com/demerphq/Data-Undump.
To install Data::Undump, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Undump
CPAN shell
perl -MCPAN -e shell install Data::Undump
For more information on module installation, please visit the detailed CPAN module installation guide.