Test::Smoke::Util::Serialise - Serialise (stringify) values, a bit like Data::Dumper.
use Test::Smoke::Util::Serialise 'serialise'; my $value = [ qw( one two three ) ]; printf "Looks like: '%s'\n", serialise($value); # Looks like: '[one, two, three]'\n
Mostly looks like Data::Dumper::Dumper, with $Indent = 0, $Sortkeys = 1 and $Terse = 1.
$Indent = 0
$Sortkeys = 1
$Terse = 1
Make a string representation of the argument passed.
Arrays are represented with enclosing square brackets
Hashes are represented with enclosing curly braces, where all te Key-Value-pairs have enclosing parenthesis with a => (fat comma) in-between.
=>
{(one => two), (three => [four, five]), (six => {(seven => eight)}, (nine => \ten))}
Positional:
A string representation of the value passed.
(c) 2020, Abe Timmerman <abeltje@cpan.org> All rights reserved.
With contributions from Jarkko Hietaniemi, Merijn Brand, Campo Weijerman, Alan Burlison, Allen Smith, Alain Barbet, Dominic Dunlop, Rich Rauenzahn, David Cantrell.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See:
http://www.perl.com/perl/misc/Artistic.html
http://www.gnu.org/copyleft/gpl.html
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Test::Smoke, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Smoke
CPAN shell
perl -MCPAN -e shell install Test::Smoke
For more information on module installation, please visit the detailed CPAN module installation guide.