Hello Monks,
I'm using some strings in a scripts as constants as they are strings used in parsing of file. But I've noticed a small oddity on this. So is this expected (couldn't find any reference in camel book on this).
> perl -we 'use constant K => 0;$array[0]="value";print $array[K],"\n"
+;'
value
> perl -we 'use constant K => KEY;$hash{"KEY"}="value";print $hash{K},
+"\n";'
Use of uninitialized value in print at -e line 1.
The array works as I expected. The hash does not. Is it better to use scalar even though it is not constant (used to do these that way)?