You need to use the Exporter module in your module, and use the constant-holding module in your main program.
package Constants: use strict; use vars qw( @ISA @EXPORT_OK ); require Exporter; @ISA = qw( Exporter ); use constant IP_ADDR = '192.34.56.78'; # and in another file use Constants qw( IP_ADDR );
In reply to Re: Include Constants from other files
by chromatic
in thread Include Constants from other files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |