NAME

Test::Smoke::Util::Serialise - Serialise (stringify) values, a bit like Data::Dumper.

SYNOPSIS

    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

DESCRIPTION

Mostly looks like Data::Dumper::Dumper, with $Indent = 0, $Sortkeys = 1 and $Terse = 1.

serialise($to_serialise)

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))}

Arguments

Positional:

1. $to_serialise

Responses

A string representation of the value passed.

COPYRIGHT

(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:

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.