Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

$player = "Sharapova";

%player_country = (
                                Venus => "USA",
                                Sharapova => "Russia",
                                Serena => "USA",
print "$player represents : ";
print $player_country;
print "\n";

@players = keys %player_country;
@values = values %player_country;

print "@players[0..$#players]\n";
print "@values[0..$#values]\n";

in the above program @values array holds all the values in the hash.
again values is a keyword used to retrieve values from hashes. how the
perl interpreter handles it ???

Re: values

Quoted text here. Click to load it

Trivial: different name spaces.
%values, @values, $values, values() can easily separeted by the sigil
resp. where/how they are used in an expression.


Site Timeline