Hash::M...::leach(3)

πŸ“¦ version 1.07, in alpine 3.24

🌸 NAME 🌸

Okay bestie, this is the Hash::M...::leach(3) page from the User Contributed Perl Documentation, and it's all about Hash::MostUtils::leach β€” the base implementation of n_each without the Perl-version-specific bits. Periodt. πŸ’…

✨ DESCRIPTION ✨

This module is included as part of the Hash::MostUtils library. 🫢

Hash::MostUtils exports two functions which this module provides: leach and n_each. See the documentation for those functions in Hash::MostUtils for a more thorough treatment of how to use them. iykyk.

leach (and n_each) both provide a splice-like interface for operating on an array. Lowkey iconic.

In Perl versions 5.12 and lower, the prototype for splice is:

sub splice (\@;$$@) { ... }

However, in Perl versions 5.13 and above, the prototype for splice is:

sub splice (+;$$@) { ... }

By extension, the functions leach and n_each need to have a similar version-specific prototype on them. Not me explaining version drama, but yes. 😭

This class serves as an interface to choose between the two prototypes based on your version of Perl. Main character energy: it literally picks the right one so you don't have to. ✨

(c) 2013 by Belden Lyman

This library is free software: you may redistribute it and/or modify it under the same terms as Perl itself; either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.


perl v5.42.2 Β· 2023-11-29 Β· Hash::M...::leach(3) β€” mwah, go slay your arrays bestie πŸ’‹

πŸ“¦ where this page comes from