sub foo { "test" } $hash{ foo } = 32; #the literal string "foo" is used as the key $hash{ foo() } = 45; #the string "test" is used $x='te'; $y='st'; $hash{ $x$y } = 32; #this is a syntax error, because it's not string interpolation