Janek Schleicher <[EMAIL PROTECTED]> wrote:
> Mike Singleton wrote at Mon, 09 Sep 2002 19:19:22 +0200:
>> ...
>> my %statcode =
>>     ( "$JOBEND" => '0',
>>       "$CONDEND" => '0',
>>       "$JOBFAIL" => '-1',
>>       "$JOBCANC" => '-2',
>>      );
> 
> perldoc -q 'What's wrong with always quoting "$vars"?'

Actually, that FAQ-answer talks about un{wanted,necessary}
stringification - but these are hash keys so they'll get
coerced to strings regardless.

I think the reason not to quote them here is simpler:

  The quotes don't do anything, and are therefore distracting.

And is there any reason why the OP can't use the name of the
code (rather than its value) as the key ?

  my %statcode = (
      JOBEND  =>  0
      CONDEND =>  0
      JOBFAIL => -1
      JOBCANC => -2
  );

Using variables as hash-keys is also distracting.

At least it distracts me... made me look to see if the variables
could change after you create %statcode.

> BTW: You use a lot of constants.
>      Perhaps you should have a look to the constant pragma.
> 

That too.

-- 
Steve

perldoc -qa.j | perl -lpe '($_)=m("(.*)")'

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to