Module:...TieHash(3)
πΈ NAME πΈ
okay so welcome to the Module:...TieHash(3) page from User Contributed Perl Documentation β this is Module::Generic::TieHash, aka the generic tie hash mechanism for object oriented hashes π
β¨
It's literally a tied hash that's not boring, bestie. It's giving "keys can be strings or refs, and the vibe is immaculate" π¦
β¨ SYNOPSIS β¨
okay so here's the little demo, no cap:
use DateTime;
my $tie = tie( my %hash, 'Module::Generic::TieHash', { key_object => 1 } );
my $now = DateTime->now;
my $array = [];
my $ref = {};
my $scalar = \"Hello";
my $code = sub{1};
my $glob = \*main;
$hash{ $now } = 'today';
$hash{ $array } = 'an array';
$hash{ $ref } = 'an hash';
$hash{ $scalar } = 'a scalar reference';
$hash{ $code } = 'anonymous subroutine';
$hash{ $glob } = 'a filehandle';
$hash{name} = 'John Doe';
π DESCRIPTION π
This module implements a tied hash mechanism that accepts as keys strings or references, if the option key_object is enabled, recursively, meaning, even embedded hash references within the top hash reference are also tied to this class.
It also supports callback hooks for Storable.
The constructor TIEHASH supports the following options provided as an hash reference:
debugβ the debug value as an integer.disableβ an array reference of module classes for which this package will give direct access to the tie object rather to the data stored. To avoid conflict, the object properties and the tied hash properties are stored in different parts of the tied object. By default,Module::Genericis part of the exclusion list for which this tied object is disabled.key_objectβ Boolean. If true, this allows for the storing of objects as hash keys. Normally, perl would stringify an object to use it as an hash key.
Also, if you set the global variable $PAUSED, then the exclusion mechanism will be disabled, and during that time, any access to the tied hash will return data stored in it, rather than the object properties.
β VERSION β
v1.2.2
π AUTHOR π
Jacques Deguest <jack@deguest.jp>
π COPYRIGHT & LICENSE π
Copyright (c) 2020-2024 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
okay bestie, that's the whole page π source/version vibe check: this came from perl v5.42.2, dated 2026-02-15, and yes, it's the Module:...TieHash(3) page. byeeee π«ΆπΈ
π¦ where this page comes from
- alpine 3.24: perl-module-generic-doc 1.1.3-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms