Values operator extracts all the values of a hash : value « Hash « Perl






Values operator extracts all the values of a hash

   

#!/usr/bin/perl -w

# Associative array or hash values.
$hash{"Name"} = "G ";
$hash{"Address"} = "1.";
$hash{"City"} = "W";

@values = values(%hash);

print "Values are: @values\n\n";

   
    
    
  








Related examples in the same category

1.Lists the contents of an associative array using the values function:
2.Determine if the value for the key is true or false
3.Hash Key-Value Pair Retrieval
4.Reference a non-exist hash value
5.Reference one value in hash by its key in print statement
6.Using hash as the hash value
7.Using hash reference to retrieve value from hash