RE: question plz
From: David Le Blanc (david.leblanc_at_identity-solutions.com.au)
Date: 02/21/04
- Next message: David Le Blanc: "RE: lc"
- Previous message: David Le Blanc: "RE: $self"
- Maybe in reply to: Jacob Chapa: "question plz"
- Next in thread: R. Joseph Newton: "Re: question plz"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: David Le Blanc: "RE: lc"
- Previous message: David Le Blanc: "RE: $self"
- Maybe in reply to: Jacob Chapa: "question plz"
- Next in thread: R. Joseph Newton: "Re: question plz"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|