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!


In reply to Include external variables? by johnfl68

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.