RE: question plz

From: David Le Blanc (david.leblanc_at_identity-solutions.com.au)
Date: 02/21/04


Date: Sat, 21 Feb 2004 22:33:41 +1100
To: <WilliamGunther@aol.com>,	<SnakeO@austin.rr.com>,	<beginners@perl.org>


> From: WilliamGunther@aol.com [mailto:WilliamGunther@aol.com]
> Sent: Saturday, 21 February 2004 2:20 PM
> To: SnakeO@austin.rr.com; beginners@perl.org
> Subject: Re: question plz
>
> They're different operators. => is the same thing as the
> comma. It's sole
> difference is readability. For example
>
> %hash = ( key => "value",
> key2 => "value2",
> );
> #is the same as
> %hash = ( key, "value",
> key2,"value2",
> );

No its not.

key => "value" is the same as
"key" , "value" in most circumstances, depending on the rules of
engagement at the time. Use strict can also affect the use of
'barewords' which may prevent

key => "value" from working the same as
"key","value"

> #is the same as
> %hash = ( key, "value" =>
> key2,"value2" =>
> );

Again, what is 'key2'?? It it a word which needs quoting? a function
call?

key1=>"value",key2=>"value2"

is different than

key1,"value" => key2, "value2"

because in the first instance, 'key2' is effectively quoted, in the
second it is not and may result in a function call, or a constant
being expanded, etc.



Relevant Pages

  • Re: question plz
    ... => is the same thing as the comma. ... It's sole ... difference is readability. ... Handy Yet Cryptic Code. ...
    (perl.beginners)
  • Re: Excel 2007 Formula problem .
    ... You normally have a comma or semi-colon between the parameters, ... depending on your regional settings, ...
    (microsoft.public.excel)
  • Comma after initial "Yet"
    ... What are the current rules about comma after this initial "Yet?" ... I feel that in speech the pause after it could be either short or ... depending on the stress one wants to place on the reservations ...
    (alt.usage.english)
  • Re: Check if String has a number
    ... Helmut Meukel wrote: ... depending on where the numberare, ... comma after the 1. ... "We sew confusion" ...
    (microsoft.public.vb.general.discussion)
  • Re: How do I separate first and last names into two columns?
    ... Look at Data>Text To Columns, with a separator of space or comma, depending ... upon the original data. ... Thanks for your assistance in this matter. ...
    (microsoft.public.excel.misc)