Test::S...rialise(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’–

Test::Smoke::Util::Serialise β€” bestie, it serialises (aka stringifies) values, a lil bit like Data::Dumper does. No cap. πŸ’…


✨ 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 πŸ¦‹

Okay so picture Data::Dumper::Dumper, right? It mostly looks exactly like that, except with $Indent = 0, $Sortkeys = 1 and $Terse = 1. That's the vibe. πŸŽ€

🌸 serialise($to_serialise)

It makes a string representation of the argument you hand it. That's it, that's the whole job. πŸ‘‘

Arrays get wrapped up in square brackets. Simple. Iconic.

Hashes get wrapped up in curly braces, and listen β€” every single Key-Value-pair inside gets its own enclosing parenthesis with a => (fat comma, you know her) in-between. So it's giving:

{(one => two), (three => [four, five]), (six => {(seven => eight)}, (nine => \ten))}

πŸ’œ Arguments

Positional:

  1. $to_serialise

πŸ’œ Responses

A string representation of the value passed. That's what you get back. Periodt. 🫢


(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. Look at that lineup, literal legends, we stan. 🌈

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. Bestie I'm so serious, no promises, she's out here doing her best with zero guarantees. πŸ’€

Okay that's the whole page, mwah πŸ’‹ β€” brought to you by perl v5.42.0, dated 2025-07-25, and yes this is Test::S...rialise(3), go forth and serialise responsibly. 🧚✨

πŸ“¦ where this page comes from