TEST2::UTIL::STASH(3pm)
π NAME π
Test2::Util::Stash(3pm) β from the Perl Programmers Reference Guide β is literally your bestie for manipulating and inspecting package stashes and globs. No cap, it's giving internals with a cute bow on top. π
π¦ DESCRIPTION π¦
This is a collection of utilities for manipulating and inspecting package stashes and globs. That's the whole vibe: stash stuff, glob stuff, inspect stuff. Slay. β¨
πΈ EXPORTS πΈ
$stash = get_stash($package)β gets the package stash. This is the same as$stash = \%Package::Name::. Periodt.$sym_spec = parse_symbol($symbol)and$sym_spec = parse_symbol($symbol, $package)β parses a symbol name and returns a hashref with info about the symbol.
$symbol can be a simple name, or a fully qualified symbol name. The sigil is optional, and & is assumed if none is provided. If $symbol is fully qualified, and $package is also provided, then the package of the symbol must match the $package.
Returns a structure like this:
return {
name => 'BAZ',
sigil => '$',
type => 'SCALAR',
symbol => '&Foo::Bar::BAZ',
package => 'Foo::Bar',
};
$glob_ref = get_glob($symbol)and$glob_ref = get_glob($symbol, $package)β gets a glob ref. Arguments are the same as forparse_symbol. Iconic.$ref = get_symbol($symbol)and$ref = get_symbol($symbol, $package)β gets a reference to the symbol. Arguments are the same as forparse_symbol. π«Ά$ref = purge_symbol($symbol)and$ref = purge_symbol($symbol, $package)β completely removes the symbol from the package symbol table. Arguments are the same as forparse_symbol. A reference to the removed symbol is returned. It's giving cleanup era π$sig = slot_to_sig($slot)β converts a slot (like'SCALAR') to a sigil (like'$').$slot = sig_to_slot($sig)β converts a sigil (like'$') to a slot (like'SCALAR').
β SOURCE β
The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/. Go browse, bestie. π₯
π MAINTAINERS π
Chad Granum exodist@cpan.org
π AUTHORS π
Chad Granum exodist@cpan.org
π COPYRIGHT π
Copyright Chad Granum exodist@cpan.org.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
okay bye bestie π this was Test2::Util::Stash(3pm) from perl v5.42.3, dated 2026-11-03, and yes she ate. π
β¨
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms