> -----Original Message----- > From: Dean Theophilou [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 21, 2002 2:16 PM > To: Perl_beginner (E-mail) > Subject: The => in Hashes > > > Hello: > > There have been many times that I have seen a hash like this: > > %Hash = ("Key1" => "Value1"); > > My question is that if the => operator quotes stuff to > the left of it, then why > bother quoting the Key1 portion of the hash definition?
=> only quotes a bareword that is a legal identifier name, with an optional leading minus sign. Key1 in your example qualifies, so there is no need to quote it. Something like "First Name", or "123" doesn't qualify, so they need to be quoted. > > Also, what the !@#$!@# is "foo"! :) It's just a dummy name to be used in examples, etc. If you want all the poop, see: http://www.tuxedo.org/~esr/jargon/html/entry/foo.html HTH (which itself is explained at http://www.tuxedo.org/~esr/jargon/html/entry/HTH.html) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
