(though i guess DOUBLE_BYTE could be a constant, in which case the key is really the constant's value.)Actually, it's not:
By that logic, it should print 'b' instead. Remember, "constants" in Perl are really just subroutines, not C-style macros. The rule that a bareword as a hash key is always treated as a string applies whether or not there's a subroutine or constant with that name defined.use constant a => 'b'; my %foo; $foo{a} = "x"; print keys %foo; __END__ a
In reply to Re^2: Snippet explanation please
by Errto
in thread Snippet explanation please
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |