because if you don't have a BEGIN { } block around the require, the constants will be loaded at runtime. In other words, they aren't yet known at compile time of the script. Adding parens in this case is a hint to the compiler that the constants are subroutines (which they internally are), not barewords. | [reply] [d/l] [select] |
| [reply] [d/l] [select] |
Well, if you do it properly (i.e. use BEGIN {} in this case), you don't need the parens (except in some rare cases where disambiguation is needed), and you have the added performance benefit of the subroutines being optimized away.
Of course you can't interpolate subroutine calls in double quoted strings... which is a clear disadvantage if constant. But Readonly, OTH, is slow (because it relies on tied magic), and may occasionally cause other strangeness (for an example, see runtime problem; elusive error).
| [reply] [d/l] |