use constant CONST => { foo => 'bar', fiz => 'baz' }; foreach (keys CONST) { print "$_\n"; } #### Type of arg 1 to keys must be hash (not constant item) #### foreach (keys %{CONST}) { print "$_\n"; } #### Variable "%CONST" is not imported