in reply to How to create a "CONSTANT"

You're talking about global variables, not constants. Globals must be declared with the vars pragma or fully-qualified.

use strict; use vars qw($PIE); $PIE = 'Pumpkin'; print "pie: $PIE\n";

Replies are listed 'Best First'.
Re: Re: How to create a "CONSTANT"
by sauoq (Abbot) on Jun 05, 2003 at 23:31 UTC
    You're talking about global variables, not constants.

    He's talking about old-school constants... (you know... the way we used to do it... back in the paradise garage...)

    $ perl -le '*PIE=\"Apple"; $PIE = "foo"' Modification of a read-only value attempted at -e line 1.

    Please excuse my Doc Martin impression.

    -sauoq
    "My two cents aren't worth a dime.";