Pardon this posting which'll probably display my ignorance of how use and namespaces work...

I have a system of cooperating perl scripts that all use a small number of critical parameters -- my so called "big levers", as moving any of them slightly has a big effect on final conclusions. I put these variables in a .pm file and  use them in my different scripts. (see sample below) One of my scripts generates a plethora of excel reports. As these levers matter so much, I'd like to include these big levers at the bottom of every report, to show the scenario the report reflects.

My questions is:

After a script does  use BigLevers;, how can I examine the namespace to determine which global vars the  use set? In this toy example, the answer I'm seeking is the list $NETOVERGROSS_ORDS, $NETOVERGROSS_DOLS, $FNEW_GROSS_ORDS, $FNEW_GROSS_DOLS, so I then I can pump these vars and their values onto my reports.

Parsing these names out of the physical file doesn't seem elegant, surely I can grab them from Perl itself after they've been loaded?

nop
## The Big Levers use strict; use vars qw($NETOVERGROSS_ORDS $NETOVERGROSS_DOLS $FNEW_GROSS_ORDS $FNEW_GROSS_DOLS); $NETOVERGROSS_ORDS = .98; $NETOVERGROSS_DOLS = .97; $FNEW_GROSS_ORDS = .35; $FNEW_GROSS_DOLS = .35; 1;

In reply to What vars did it define? by nop

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.