Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

autobox::dump(3pm) [debian man page]

autobox::dump(3pm)					User Contributed Perl Documentation					autobox::dump(3pm)

NAME
autobox::dump - human/perl readable strings from the results of an EXPR VERSION
Version 20090426.1746 SYNOPSIS
The autobox::dump pragma adds, via the autobox pragma, a method to normal expression (such as scalars, arrays, hashes, math, literals, etc.) that produces a human/perl readable representation of the value of that expression. use autobox::dump; my $foo = "foo"; print $foo->perl; # "foo"; print +(5*6)->perl; # 30; my @a = (1..3); print @a->perl; # [ # 1, # 2, # 3 # ]; print {a=>1, b=>2}->perl; # { # "a" => 1, # "b" => 2 # }; sub func { my ($x, $y) = @_; return $x + $y; } my $func = &func; print $func->perl; #sub { # BEGIN { # $^H{'autobox_scope'} = q(154456408); # $^H{'autobox'} = q(HASH(0x93a3e00)); # $^H{'autobox_leave'} = q(Scope::Guard=ARRAY(0x9435078)); # } # my($x, $y) = @_; # return $x + $y; #} You can set Data::Dumper options by passing either arrayrefs of option and value pairs or just keys (in which case the option will be set to 1). The default options are C<qw/Indent Terse Useqq Sortkeys Deparse/>. print ["a", 0, 1]->perl([Indent => 3], [Varname => "a"], qw/Useqq/); #$a1 = [ # #0 # "a", # #1 # 0, # #2 # 1 # ]; You can also call the class method ->options to set a different default. #set Indent to 0, but leave the rest of the options autobox::dump->options([Indent => 0], qw/Terse Useqq Sortkeys Deparse/); print ["a", 0, 1]->perl; #["a",0,1] AUTHOR
Chas. J Owens IV, "<chas.owens at gmail.com>" BUGS
Has all the issues autobox has. Has all the issues Data::Dumper has. This pragma errs on the side of human readable to the detriment of Perl readable. In particular it uses the terse and deparse options of Data::Dumper by default. These options may create code that cannot be eval'ed. For best eval results, set options to "qw/Purity/". Note, this turns off coderef dumping. Please report any bugs or feature requests to http://github.com/cowens/autobox-dump/issues SUPPORT
You can find documentation for this module with the perldoc command. perldoc autobox::dump ACKNOWLEDGEMENTS
Michael Schwern for starting the perl5i pragma which prompted me to add a feature I wanted to autobox. COPYRIGHT &; LICENSE Copyright 2009 Chas. J Owens IV, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2009-04-26 autobox::dump(3pm)

Check Out this Related Man Page

Template::Plugin::Dumper(3pm)				User Contributed Perl Documentation			     Template::Plugin::Dumper(3pm)

NAME
Template::Plugin::Dumper - Plugin interface to Data::Dumper SYNOPSIS
[% USE Dumper %] [% Dumper.dump(variable) %] [% Dumper.dump_html(variable) %] DESCRIPTION
This is a very simple Template Toolkit Plugin Interface to the Data::Dumper module. A "Dumper" object will be instantiated via the following directive: [% USE Dumper %] As a standard plugin, you can also specify its name in lower case: [% USE dumper %] The "Data::Dumper" "Pad", "Indent" and "Varname" options are supported as constructor arguments to affect the output generated. See Data::Dumper for further details. [% USE dumper(Indent=0, Pad="<br>") %] These options can also be specified in lower case. [% USE dumper(indent=0, pad="<br>") %] METHODS
There are two methods supported by the "Dumper" object. Each will output into the template the contents of the variables passed to the object method. dump() Generates a raw text dump of the data structure(s) passed [% USE Dumper %] [% Dumper.dump(myvar) %] [% Dumper.dump(myvar, yourvar) %] dump_html() Generates a dump of the data structures, as per dump(), but with the characters <, > and & converted to their equivalent HTML entities and newlines converted to <br>. [% USE Dumper %] [% Dumper.dump_html(myvar) %] AUTHOR
Simon Matthews <sam@tt2.org> COPYRIGHT
Copyright (C) 2000 Simon Matthews. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Template::Plugin, Data::Dumper perl v5.14.2 2011-12-20 Template::Plugin::Dumper(3pm)
Man Page