use constant Z => 1984; my %h = (); $h{+Z} = 123; print Dumper \%h; # as expected