> -----Original Message----- > From: Kaushal Shriyan [mailto:[EMAIL PROTECTED] > Sent: Monday, October 29, 2007 11:25 PM > To: beginners@perl.org > Subject: Re: Hash Variables > > 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.
First, I must confess that I am unsure of the effect of not placing "apple" and "banana" in quotation marks (but this is the place to get opinions <g>). Taking the style from SAS macro calls, I might write: my %fruit_color = ( apple => "red" , banana => "yellow" , ) ; The Llama book states that the last comma is "harmless, but convenient". I might be inclined to avoid it (but I need to test it): my %fruit_color = ( apple => "red" , banana => "yellow" ) ; HTH, Kevin Kevin Viel, PhD Post-doctoral fellow Department of Genetics Southwest Foundation for Biomedical Research San Antonio, TX 78227 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/