So, as described in
use,
use mylib; is exactly equivalent to
BEGIN { require Module; Module->import( LIST ); }. When you don't define your value in a BEGIN block, the implicit BEGIN in
use constant beats it in the foot race, since (as documented in
BEGIN, UNITCHECK, CHECK, INIT and END)
A BEGIN code block is executed as soon as possible, that is, the moment it is completely defined, even before the rest of the containing file (or string) is parsed. You may have multiple BEGIN blocks within a file (or eval'ed string); they will execute in order of definition.
You can even have nested BEGIN blocks, where order of operations gets applied recursively. In fact, since you will
use mylib; to get to your module, that's exactly what happens.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.