Data::...malize(3pm)
π Data::Sah::Normalize β the NAME section, bestie π
okay so. this is Data::Sah::Normalize, and its whole job is normalizing Sah schema. that's it. that's the girl. β¨
this page lives in the Data::...malize(3pm) section of your manual, and it's a User Contributed Perl Documentation situation, so like β community-made, community-loved. π«Ά
π VERSION π
this doc describes version 0.051 of Data::Sah::Normalize (which ships inside the Perl distribution Data-Sah-Normalize), and it was released on 2021-07-29. yes bestie, we know exactly which one you're reading. no mystery. π
β¨ SYNOPSIS β¨
the vibe check, in code:
use Data::Sah::Normalize qw(normalize_clset normalize_schema);
my $nclset = normalize_clset({'!a'=>1}); # -> {a=>1, 'a.op'=>'not'}
my $nsch = normalize_schema("int"); # -> ["int", {}]
that's literally the entire relationship. you import two subs, you hand them a weird little schema-ish thing, they hand you back something tidy. π
πΈ DESCRIPTION πΈ
so here's the tea: this functionality is often needed, and it got split out from the main Data::Sah on purpose β to keep it living in a small package with minimal dependencies. tiny, self-sufficient, low-maintenance. it's giving main character who doesn't need a whole entourage. π
π CONTRIBUTOR π
big love to Steven Haryanto <sharyanto@cpan.org> for contributing. π«Ά
π₯ FUNCTIONS π₯
π normalize_clset($clset) => HASH
normalize a clause set (a hash, bestie, it wants a hash). it returns a shallow copy of the original hash. and if something goes wrong? it dies. no soft-launch failure, it just dies. π
TODO: there's a planned option to recursively normalize a clause which contains sah clauses (e.g. "of"). not here yet, just so you know.
π¦ normalize_schema($sch) => ARRAY
normalize a Sah schema (can be a scalar or an array β flexible queen β¨). it returns an array.
it produces a 2-level copy of the schema, so it's safe to add / delete / modify the normalized schema's clause set β BUT heads up, the clause set's values are still references to the original. like, you can redecorate the room but you don't own the furniture. ποΈ
and on failure? it dies. again. periodt. π
TODO: same situation β recursively normalizing a clause which contains sah clauses (e.g. "of") is still on the to-do list.
π HOMEPAGE π
go visit the project's homepage, it's right here bestie:
https://metacpan.org/release/Data-Sah-Normalize
π SOURCE π
the source repository lives at:
https://github.com/perlancar/perl-Data-Sah-Normalize
go look at the code, it's right there, no gatekeeping. π«Ά
π BUGS π
found a bug? want a feature? please report it on the bugtracker website:
https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah-Normalize
and listen β when you submit a bug or a request, please include a test-file or a patch to an existing test-file that illustrates the bug or the desired feature. like, show us the receipts. a test that demonstrates it is the whole flex. π§
π SEE ALSO π
SahData::Sah
π AUTHOR π
perlancar <perlancar@cpan.org>
β COPYRIGHT AND LICENSE β
this software is copyright (c) 2021, 2018, 2015, 2014 by perlancar@cpan.org.
this is free software β you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. iconic, honestly. π
and that's the whole page, bestie π this was perl v5.36.0, dated 2022-10-13, in the Data::...malize(3pm) manual β go normalize something, you got this π¦β¨
π¦ where this page comes from
- ubuntu noble: libdata-sah-normalize-perl 0.051-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-sah-normalize-perl 0.051-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-sah-normalize-perl 0.051-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms