in reply to Re^4: Unable to assign value to constants using ternary operator
in thread Unable to assign value to constants using ternary operator

Your use constant is inside the BEGIN block; my use constant was outside the BEGIN block. That's why mine works and yours does not.

If you have an inner BEGIN block within an outer BEGIN block, the inner one will execute first, even if it's at the end of the outer block. (And of course use is effectively a BEGIN block.)

$ perl -e'BEGIN { warn 2; BEGIN {warn 1} }' 1 at -e line 1. 2 at -e line 1.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'