in reply to All uppercase subs
You can't easily interpolate 'constants' as they lack the sigil, and because of that, they also get auto-quoted on the left of a fat arrow, or if it's the only thing in a hash index. Furthermore, if you see:
does that mean that $variable becomes one more than the constant ALL_CAPS, or does $variable get the result of ALL_CAPS(1)?my $variable = ALL_CAPS + 1;
Luckely, there's Readonly.pm:
Much better, IMO.use Readonly; Readonly my $PI => 4 * atan2(1, 1); Readonly my $DEBUG => 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: All uppercase subs
by bart (Canon) on Jul 17, 2005 at 11:59 UTC | |
|
Re^2: All uppercase subs
by blazar (Canon) on Jul 18, 2005 at 13:56 UTC |