# package to group all constant, read-only vars like $DEBUG # file is Constants.pm and can be placed in same dir as main script # or in a './lib' dir, make sure to adjust 'use lib...' in any subscript it uses it package Constants; use strict; use warnings; # boilerplate use Exporter; our @ISA = qw/Exporter/; # add here all the variables you want exported our @EXPORT = qw/$CON1 $CON2 $DEBUG/; our $CON1 = 'a constant'; our $CON2 = 'another constant'; our $DEBUG = 1; 1;