Constant Folding
Like C, Perl does a certain amount of expression evaluation at compile time whenever it determines that all arguments to an operator are static and have no side effects. In particular, string concatenation happens at compile time between literals that don't do variable substitution. Backslash interpolation also happens at compile time. You can say
'Now is the time for all' . "\n" . 'good men to come to.'
and this all reduces to one string internally. Likewise, if you say
foreach $file (@filenames) { if (-s $file > 5 + 100 * 2**16) { } }
the compiler precomputes the number which that expression represents so that the interpreter won't have to.
Please login to continue.