Hi

I am referring to perldoc perlintro
my %fruit_color = ("apple", "red", "banana", "yellow");

You can use whitespace and the "=>" operator to lay them out more nicely:

               my %fruit_color = (
                   apple  => "red",
                   banana => "yellow",
               );

I know to use the Fat Comma Operator, How can one use the whitespace to lay
the Hash Key/Values Pair. Please explain me with the above example.

Thanks and Regards

Kaushal




On 10/29/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a sample code
>
> ########################################################
>
> #!/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
>
> Thanks in Advance.
>
> Thanks and Regards
>
> Kaushal
>
>

Reply via email to