Movatterモバイル変換


[0]ホーム

URL:


functions /values
(source,CPAN)
You are viewing the version of this documentation from Perl 5.8.1.View the latest version
#values HASH

Returns a list consisting of all the values of the named hash. (In a scalar context, returns the number of values.)

The values are returned in an apparently random order. The actual random order is subject to change in future versions of perl, but it is guaranteed to be the same order as either thekeys oreach function would produce on the same (unmodified) hash. Since Perl 5.8.1 the ordering is different even between different runs of Perl for security reasons (see"Algorithmic Complexity Attacks" in perlsec).

As a side effect, calling values() resets the HASH's internal iterator, see"each".

Note that the values are not copied, which means modifying them will modify the contents of the hash:

for (values %hash)     { s/foo/bar/g }   # modifies %hash valuesfor (@hash{keys %hash}) { s/foo/bar/g }   # same

See alsokeys,each, andsort.

Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.

The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.


[8]ページ先頭

©2009-2025 Movatter.jp