in reply to simple substitution

if you are defining "UPPER_LIMIT" for a single script then
use constant UPPER_LIMIT => 10;
as suggested by lidden will be fine.If you want to scale up and use the same constant in multiple scripts then you can define the constant (and all common VARS that you scripts) in a file and require that file in you scripts! To illustrate this type the following
$UPPER_LIMIT=10; 1;
in a file called "ENV.pl"(Please note the 1 thats returned in last line), then in you scripts use
require "ENV.pl";
This will import the contents of ENV.pl

The world is so big for any individual to conquer

Replies are listed 'Best First'.
Re^2: simple substitution
by ikegami (Patriarch) on Nov 02, 2007 at 06:32 UTC
    Using require to load a file without a package statement is asking for trouble. Use do for such files.

    Better yet if you're going for re-use, make a real module (one that uses package) and use Exporter or the like to allow the user code to import only the constants and variables it needs.