Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hash::Util

Native Rust implementation built into the interpreter. Runtime: P5. See original documentation for the full Perl reference.

Implements all 39 Hash::Util functions for the p5 runtime. Operates directly on P5Sv/P5HvBody/P5He raw pointers.

Hash locking uses SVF_READONLY flag (perl5 sv.h bit 27):

  • On an HV SV: keys are restricted (no new keys allowed).
  • On a value SV: value is read-only (immutable). Placeholder entries use sv_placeholder() sentinel (hidden keys in a restricted hash that have been “deleted” or never assigned).

Functions

all_keys

populate arrays with visible and hidden keys

clear_placeholders

remove placeholder entries

hash_locked

returns 1 if keys restricted, 0 otherwise

hash_unlocked

returns 1 if keys NOT restricted, 0 otherwise

hashref_locked

same as hash_locked

hashref_unlocked

same as hash_unlocked

hidden_keys

returns list of hidden (placeholder) keys

hidden_ref_keys

same as hidden_keys

hv_store

store key/value pair

returns all legal keys (visible + hidden)

same as legal_keys

lock_hash

lock_hash_recurse

lock_hashref

same as lock_hash but takes a hashref directly

lock_hashref_recurse

lock_keys

lock_ref_keys

lock_ref_keys_plus

lock_ref_value

lock_value

unlock_hash

unlock_hash_recurse

unlock_hashref

same as unlock_hash but takes a hashref directly

unlock_hashref_recurse

unlock_keys

unlock_ref_keys

unlock_ref_value

unlock_value