If you don't want to declare with our or use constant (maybe also take a look at Readonly, but that seems to exact a speed penalty (Update: see thread Module Readonly, esp. the most recent reply)), $::myVar is a little bit less typing than $main::myVar (well, at least as long as you're in the main package).
>perl -wMstrict -le "*myVar = \3.14159; print $::myVar; " 3.14159
In reply to Re: Typeglobs and constant variables
by AnomalousMonk
in thread Typeglobs and constant variables
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |