Data::Dump::Streamer

Accurately serialize a data structure as Perl code
Download

Data::Dump::Streamer Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Yves
  • Publisher web site:
  • http://search.cpan.org/~yves/

Data::Dump::Streamer Tags


Data::Dump::Streamer Description

Given a list of scalars or reference variables, writes out their contents in perl syntax. The references can also be objects. The contents of each variable is output using the least number of Perl statements as convenient, usually only one. Self-referential structures, closures, and objects are output correctly.The return value can be evaled to get back an identical copy of the original reference structure. In some cases this may require the use of utility subs that Data::Dump::Streamer will optionally export.Data::Dump::Streamer is a Perl module, very similar in concept to the core module Data::Dumper, with the major differences being that this module is designed to output to a stream instead of constructing its output in memory (trading speed for memory), and that the traversal over the data structure is effectively breadth first versus the depth first traversal done by the others.In fact the data structure is scanned twice, first in breadth first mode to perform structural analysis, and then in depth first mode to actually produce the output, but obeying the depth relationships of the first pass.SYNOPSIS use Data::Dump::Streamer; use DDS; # optionally installed alias Dump($x,$y); # Prints to STDOUT Dump($x,$y)->Out(); # " " my $o=Data::Dump::Streamer->new(); # Returns a new ... my $o=Dump(); # ... uninitialized object. my $o=Dump($x,$y); # Returns an initialized object my $s=Dump($x,$y)->Out(); # " a string of the dumped obj my @l=Dump($x,$y); # " a list of code fragments my @l=Dump($x,$y)->Out(); # " a list of code fragments Dump($x,$y)->To(\*STDERR)->Out(); # Prints to STDERR Dump($x,$y)->Names('foo','bar') # Specify Names ->Out(); Dump($x,$y)->Indent(0)->Out(); # No indent Dump($x,$y)->To(\*STDERR) # Output to STDERR ->Indent(0) # ... no indent ->Names('foo','bar') # ... specify Names ->Out(); # Print... $o->Data($x,$y); # OO form of what Dump($x,$y) does. $o->Names('Foo','Names'); # ... $o->Out(); # ...Product's homepage


Data::Dump::Streamer Related Software