Yves > Data-Undump-0.14 > Data::Undump

Download:
Data-Undump-0.14.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.14   Source   Latest Release: Data-Undump-0.15

NAME ^

Data::Undump - Perl extension for securely and quickly deserializing simple Data::Dumper dumps

SYNOPSIS ^

  use Data::Undump qw(undump);
  
  my $dump= Data::Dumper->new([$simple_thing])->Terse(1)->Dump();
  undump($dump);

DESCRIPTION ^

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.

EXPORT

By default exports the undump subroutine.

FUNCTIONS ^

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.

Restricted to objects nested up to 100 items deep.

POTENTIAL ENHANCEMENTS ^

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.

SEE ALSO ^

Data::Dumper, eval

AUTHOR ^

Yves Orton <demerphq@gmail.com>

with contributions by:

Steffen Mueller <smueller@cpan.org> Rafael Garcia-Suarez <rgs@consttype.org>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: