For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > October 2006 > Similar variables for different PERL scripts









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Similar variables for different PERL scripts
voichekm

2006-10-20, 10:48 pm

Hi,

I have two related PERL scripts both using around 20 similar general variables:

our $myEmail = "..."; # In case of a problem
our $debugLevel = 1;
our $hostName = `hostname`;
our $progName = $0; # Current program name
our $DBuser = ...
our $DBpswd = ...
...
...

Problem is that in case of a change, I need to update two scripts.

My question is: what is the best way to have these variables defined only once at some external location and import them into the two scripts.

Thank you,
Michael
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com