in reply to Re: Re: Re: Ugly syntax
in thread Ugly syntax

Some of the mod_perl scripts I inherited used loads of constants. I think they suck because a) interpolation doesn't work properly and b) you get an annoying 'redefinition' warning under mod_perl first time you run the script

I prefer using a stack of variables with all caps at the top of each script, for example:

my $SMTP = 'blah'; my $EMAIL = 'blah@blah.com'

All my other variables are all lower case, and while these aren't 'true' constants I don't ever modify them.

Gav.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Ugly syntax
by perrin (Chancellor) on Dec 05, 2001 at 02:28 UTC
    You actually can make interpolation work, but it's ugly.

    ${[CONSTANT]}
    You shouldn't get redefinition warnings under mod_perl. Check the guide for information on what could be causing it.