On Sun, Mar 27, 2005 at 11:49:47AM -0800, Michael G Schwern wrote:
> 
> If you want a string which cannot be changed and is memory efficient you can
> alias a global to a reference to a string constant.
> 
>       our $STR;  *STR = \"Some string";
> 
> Whether or not this should be documented in constant.pm... probably just
> so long as its clear its an *-->implementation detail<--* and can change
> with each version of Perl.


Alternatively, one can use the less cryptic:

    use Readonly;
    Readonly my $STR => "Some string";


Abigail

Attachment: pgpyKA1rpD4DR.pgp
Description: PGP signature

Reply via email to