Your goals are a little contradictory. One thing Perl modules are meant to simplify is not throwing everything into the same namespace. That's why Exporter does it in a controlled fashion. As it points out,

Exports pollute the namespace of the module user.
The idea is to maintain some control over the level of sharing. But if you're going to have a thousand globals being shared, you're going against the grain of packages and modules (not to mention good programming practice).

If all you're interested in is having your program read in a bunch of variables and values, don't use modules. Instead, you can use the do function to read them in, something like this:

# stuff.pl $fred = 'foo'; $barney = 'bar'; # ...
Later in the calling program:
#! /usr/bin/perl # no strict unless "stuff.pl" my's everything. # (In which case all the vars will be lexical here.) do 'stuff.pl' or die "Couldn't read the stuff"; print $fred, "\n";
Note: I'm not recommending you implement the above code. Rather, you may want to think about why you want to share so much data, and whether there's a better way to manage it.


In reply to Re: Importing Symbol Tables by VSarkiss
in thread Importing Symbol Tables by moebius

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.