Something like this then??? === Start === use constant JOBSTART => 'SNBJH_3203J'; # Condense start use constant CONDSTART => 'SNBJH_3403'; # Job end use constant JOBEND => 'SNBJH_3211J'; # Condense end use constant CONDEND => 'SNBJH_3401J'; # Job cancelled use constant JOBCANC => 'SNBJH_3258J'; # Job fail use constant JOBFAIL => '-1'; # Volsers used use constant VOLUSED => 'SNBJH_3320J';
my %statcode = ( JOBEND => 0 CONDEND => 0 JOBFAIL => -1 JOBCANC => -2 ); === End=== "Steve Grazzini" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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]