Joined January 2012
·

Toby Inkster

PerlRDF
·
Lewes, GB-ESX
·
·

Posted to Constants in Perl over 1 year ago

Constants created with the constant pragma don't result in function calls. They're optimized away by the compiler. (This includes constants interpolated in strings like ${\FOO}.) The only ways to force Perl not to optimize a constant away are to call it with a leading ampersand, or to call it as a method.

Posted to Constants in Perl over 1 year ago
# interpolation...
use constant NAME => "Toby Inkster";
say "My name is ${\ NAME }";
Achievements
154 Karma
1,800 Total ProTip Views