Hash::...:Extra(3pm)
π Hash::Merge::Extra β the extra-behaviors expansion pack π
okay so bestie, this is Hash::Merge::Extra, a lil' User Contributed Perl Documentation page for Hash::Merge::Extra β the Collection of extra behaviors for Hash::Merge. It's giving "I brought snacks to the merge party" and honestly? Iconic. π
β¨ NAME β¨
Hash::Merge::Extra β a whole Collection of extra behaviors for Hash::Merge π¦
πΈ VERSION πΈ
Version 0.06 β yes, it's giving vintage-but-cunty, we love her π
π SYNOPSIS π
Lowkey the whole vibe in four lines, no cap:
use Hash::Merge qw(merge);
use Hash::Merge::Extra;
Hash::Merge::set_behavior('R_OVERRIDE');
$result = merge($left, $right);
So you pull in Hash::Merge, you pull in Hash::Merge::Extra, you pick a behavior with Hash::Merge::set_behavior('R_OVERRIDE'), and then you merge($left, $right) your little heart out. Periodt. β¨
π«Ά EXPORT π«Ά
Nothing is exported. Fr fr, zero exports unless you ask nicely.
But β and this is the main character moment β all behaviors registered in Hash::Merge if you use it like this:
use Hash::Merge::Extra;
Nothing registered if you pass an empty list, i.e. you're in your minimalist era:
use Hash::Merge::Extra qw();
And only the specified behaviors registered if you actually define a list, like so:
use Hash::Merge::Extra qw(L_OVERRIDE R_REPLACE);
So likeβ¦ pick your fighters. Choose wisely, bestie. π¦
π BEHAVIORS π
π₯ L_ADDITIVE, R_ADDITIVE
Hashes merged, arrays joined, undefined scalars overridden. Left and right precedence, depending on which one you picked. It's giving "everyone gets a plus-one" energy. β¨
π
L_OVERRIDE, R_OVERRIDE
Hashes merged, arrays and scalars overridden. Left and right precedence. Hashes still play nice, but arrays and scalars? They get overruled, bestie. No discussion. π
π L_REPLACE, R_REPLACE
Nothing merged. One thing simply replaced by another. Left and right precedence. It's the "not me replacing your whole existence" behavior and honestly it's lowkey brutal but it is the assignment. π
π AUTHOR π
Michael Samoglyadov, "<mixas at cpan.org>" β the legend who made this happen. Shoutout. π«Ά
π BUGS π
Please report any bugs or feature requests to https://github.com/mr-mixas/Hash-Merge-Extra.pm/issues β like, don't just suffer in silence, that's not the vibe. Tell the maintainers. They wanna know. π
π§ SEE ALSO π§
Hash::Mergeβ the parent, the blueprint, the OG π
β LICENSE AND COPYRIGHT β
Copyright 2017,2018 Michael Samoglyadov.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information. π
Okay so TL;DR: it's aHash::Mergeadd-on that registers extra merge behaviors, and the way youuseit decides which ones show up. Slay responsibly. π
Signed off with love β this is perl v5.40.1, dated 2025-04-10, brought to you by the Hash::...:Extra(3pm) girlypop documentation experience. Bye bestie, go merge something iconic. π
β¨π
π¦ where this page comes from
- debian trixie: libhash-merge-extra-perl 0.06-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhash-merge-extra-perl 0.06-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhash-merge-extra-perl 0.06-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