RefElem(3pm)
β¨ NAME β¨
Array::RefElem β setting up array elements as aliases, bestie π
Like, this module is in Array::RefElem, and the whole vibe is: what if an array slot and a variable were literally the same thing? No copying, no middleman, just pure aliasing energy π¦
β¨ SYNOPSIS β¨
use Array::RefElem qw(av_store av_push hv_store);
av_store(@a, 1, $a);
av_push(@a, $a);
hv_store(%h, $key, $a);
okay so you import the three functions, and then you're off to the races π
β¨ DESCRIPTION β¨
So here's the tea β β this module hands you direct access to some of the internal Perl routines that let you store things in arrays and hashes. No cap. It's giving backstage pass to perl's guts πΈ
The following functions are available:
av_store(@array, $index, $value)β Stores$valuein@arrayat the specified$index. After you run this call,$array[$index]and$valuedenote the same thing. Same thing!! Not copies. Not twins. The same thing πav_push(@array, $value)β Pushes$valueonto the@array. After you run this call,$array[-1]and$valuedenote the same thing. So the last element of the array is$value, fr fr πhv_store(%hash, $key, $value);β Stores$valuein the%hashwith the given$key. After you run this call,$hash{$key}and$valuedenote the same thing. Iconic behaviour, honestly π«Ά
ngl, the entire point here is aliasing: write through one name, see it through the other. That's the whole slay πβ¨
β¨ SEE ALSO β¨
perlgutsβ go read it if you wanna vibe with perl's internals π§
β¨ COPYRIGHT β¨
Copyright 2000 Gisle Aas.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
and that's the whole page, bestie π this was RefElem(3pm) from perl v5.42.3, dated 2026-08-19 β tysm for reading, mwah, go alias something πβ¨
π¦ where this page comes from
- ubuntu stonking: libarray-refelem-perl 1.00+ds-3build5 Β· 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