Hi Perl Monks, I have created a perl module as below, the below code contains just a few lines of the code.
package Hello; use Exporter; @ISA = ('Exporter'); # create an Exporter object. # Export all variables and functions via EXPORT statement # updated for exporting Setup CLI keys and Variables @EXPORT = qw($x $TestCase $TSPass $ConfigFile $TCPass);
The variables that are tried to be exported have to be accessed within the functions in perl module as well as outside. Ex: If i have a function testpm in the perl module Hello then the variables have to be accessed in that function as well as in the functions of the script which uses this perl module. When i run my script i get an error as below.
Global symbol "$TestCase" requires explicit package name at Hello.pm l +ine 58.
Please Please help me with this; i am badly stuck at this point. Thank You.

In reply to Problem with Perl Modules. by nisha

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.