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

T-Rex 3
Have at least three original repos where C is the dominant language

Platypus
Have at least one original repo where scala is the dominant language

Nephila Komaci 3
Have at least three original repos where PHP is the dominant language

T-Rex
Have at least one original repo where C is the dominant language

Nephila Komaci
Have at least one original repos where PHP is the dominant language

Forked
Have a project valued enough to be forked by someone else

Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos

Velociraptor
Have at least one original repo where Perl is the dominant language

Velociraptor 3
Have at least three original repos where Perl is the dominant language

Philanthropist
Truly improve developer quality of life by sharing at least 50 individual open source projects

Altruist
Increase developer well-being by sharing at least 20 open source projects

Charity
Fork and commit to someone's open source project in need
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.