What I tend to do, though its only partly satisfactory, is to use a reference to a
constant.
my $PI=\3.141592654;
print PI is $$PI\n;
$$PI=4; # Modification of a read-only value attempted at...
# Problem is you can assign the reference to something else
$PI=\4; # Works just fine only the laws of physics break down
HTH
Andie
- Original Message -
From: Story, Lenny [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 23, 2002 7:23 PM
Subject: #defines ? or Constant Data in perl ?
Greetings,
Is there some such way to define a constant, or #define style
variable in perl ?
I typically have the need to define data which is just to
eliminate the need for magic numbers etc.
thus far i have just defined variables such as :
my $WELCOME_MSG = Hello!;
print $WELCOME_MSG;
Which does work, but is not really what i want...
Any ideas anyone ?
Thanks,
Lenny
-Lenny
[EMAIL PROTECTED]
I have seen the future and it licks itself clean.
- Bucky Katt
___
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs