--- name: values status: documented runtime: pp source: src/runtime/pp/aggregate.rs --- ```{index} single: values; Perl built-in (pp runtime) ``` # values ## Synopsis ```perl my @v = values %hash; my $count = values %hash; # scalar context: number of values for my $val (values %hash) { ... } ``` ## Description Returns all values of a hash, or the number of values in scalar context. In list context, pushes all values of the hash onto the stack. In scalar context, returns the number of key-value pairs (same as `keys` in scalar context). Accepts both `%hash` and `$hashref`. Resets the hash's internal iterator as a side effect. When the REF flag is set (foreach aliasing context from the native parser), values are pushed onto the stack and the hash plus its keys are recorded for write-back of `$_` modifications during iteration. ## See also keys, each, exists, delete