| Use Case | Command | Description |
|---|---|---|
| Store an alias in an array element | av_store(@array, $index, $value) | Store $value in @array at index, making $array[$index] and $value aliases |
| Push an alias onto an array | av_push(@array, $value) | Push $value onto @array, making last element and $value aliases |
| Store an alias in a hash | hv_store(%hash, $key, $value) | Store $value in %hash with key, making $hash{$key} and $value aliases |
use Array::RefElem qw(av_store av_push hv_store);
av_store(@a, 1, $a);
av_push(@a, $a);
hv_store(%h, $key, $a);
This module gives direct access to some of the internal Perl routines that let you store things in arrays and hashes. The following functions are available:
av_store(@array, $index, $value) â Stores $value in @array at the specified $index. After executing this call, $array[$index] and $value denote the same thing.av_push(@array, $value) â Pushes $value onto the @array. After executing this call, $array[-1] and $value denote the same thing.hv_store(%hash, $key, $value) â Stores $value in the %hash with the given $key. After executing this call, $hash{$key} and $value denote the same thing.perlguts
Copyright 2000 Gisle Aas.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Generated by phpman v4.9.26-5-g7740029 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-10 21:47 @216.73.216.11
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)