use strict; use warnings; use constant { FOO => 0, BAR => 1, BAZ => 2 }; $var = BAZ; my @array; say $array[FOO]; # OK say $array[BAH]; # Bareword "BAH" not allowed while "strict subs" in use say $array[$var]; # OK #### use strict; use warnings; use constant { FOO => "foo", BAR => "bar", BAZ => "baz" }; my %hash; say $hash{+FOO}; # OK say $hash{+BAH}; # Bareword "BAH" not allowed while "strict subs" in use say $hash{+shift} # Bonus