[Nh-pm] quoting list keys & values
Ben Boulanger
ben at blackavar.com
Fri Aug 2 09:22:04 CDT 2002
On Fri, 2 Aug 2002, Erik Price wrote:
> Word to that. (And I'll definitely take you up on the advice of using
> strict and -w.) But my confusion arose from the fact that even when
> using strict, hash keys are exempt from the requirement of being quoted
> strings.
Right you are... I didn't realize you didn't get a warning with the
hashkey unquoted. I would -imagine- it's still good form to quote, but..
As this is a different question - I don't know for sure... I will say
that if you don't use a number as the assigned value, it does bark a bit:
[bboulanger at .. bboulanger]$ perl -we 'use strict; my %blah = (a => yep);
print "$blah{a}\n";'
Bareword "yep" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
--
He who hurries can not walk with dignity.
More information about the Nh-pm
mailing list