perl function values

www.i‮editfig‬a.com

The values function in Perl returns a list of all the values in a hash.

Here's an example:

%hash = ('apple' => 1, 'orange' => 2, 'banana' => 3);
@values = values(%hash);
print "Values: @values\n";

Output:

Values: 1 2 3

In the above example, a hash %hash is defined with three key-value pairs. Then, the values function is used to get a list of all the values in the hash. The list of values is stored in an array @values. Finally, the values are printed using the print function.