On Mon, 2007-10-29 at 17:06 +0530, Kaushal Shriyan wrote:

> ########################################################
> 
> #!/usr/bin/perl -w
> 
> %states = ( "California","Sacramento", "Wisconsin","Madison", "New York",
> "Albany");
> 
> print "Capital of California is " . $states{"California"} . "\n\n";
> 
> ########################################################
> 
> I did not understand the statement $states{"California"} in the above print
> statement of the code
> 
> I know the the dot is a concatenation operator and \n is a newline character



Hi  Kaushal,

%states is a hash array
California  is a key value

$states{"California"}  means the value of hash($states)  key(California)
is Sacramento


More information : # perldoc -q hash



Regs,
Siva









Reply via email to