[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-AnyPerl] constants



On Sat, 20 May 00 10:40:54 -0000, Joel Rees wrote:

>Does Perl support constants such as C's 
>     const myCompilerController = 0x68040
>or 
>     #define myCompilerController 0x68040
>?
>
>What I want is the assurance that I can't change the value of 
>myCompilerController by accident.

	use constant myCompilerController => 0x68040;
	print myCompilerController;

(actually a sub)

or

	*myCompilerController = \0x68040;
	print $myCompilerController;

(a global scalar variable, but you can't change it by accident)

BTW 0x68040 is a pretty useless constant. It's not usful when printed as
decimal, and it doesn't fit in 16 bit. Why not just simply use "68040"
or 68040?

-- 
	Bart.

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org