http://www.perlmonks.org?node_id=1006770

johnfl68 has asked for the wisdom of the Perl Monks concerning the following question:

Hello:

Is there a way to easily include external variables?

I have about a half dozen scripts that have a good deal of variables that are the same in all of them. Things like font file locations, look-up tables, etc. It would be nice if I could put these all in a common file, and then just include that file like a module. Things like this and many more:

$font41 = "/usr/share/fonts/liberation-fonts/LiberationSans-Reg +ular.ttf"; $font42 = "/usr/share/fonts/liberation-fonts/LiberationSans-Ita +lic.ttf"; $font43 = "/usr/share/fonts/liberation-fonts/LiberationSans-Bol +d.ttf"; $font44 = "/usr/share/fonts/liberation-fonts/LiberationSans-Bol +dItalic.ttf"; my %w16towdirection = ( "N", "North", "S", "South", "E", "East", "W", "West", "NE", "Northeast", "SE", "Southeast", "SW", "Southwest", "NW", "Northwest", "NNE", "North-northeast", "ENE", "East-northeast", "ESE", "East-southeast", "SSE", "South-southeast", "SSW", "South-southwest", "WSW", "West-southwest", "WNW", "West-northwest", "NNW", "North-northwest", );

I'm sure this can be done, but in searching I think I am not using quite the correct terms to get results that seem to be the answer I think I am looking for.

Any help pointing me in the right direction would be appreciated. Thanks!