hello, I'm very new to perl and have come across an aggrivating issue which I have not been able to find a solution too. I'm writing test scripts that will pump messages into the application I'm testing. My design of the scripts was to have one larger framework.pl file that would include all the setup that every test will need. then I would have a test .pl file for every type of test and that perl file would just include (or require) the framework.pl file. every thing works fine until in one of the tests I need to be able to change a variable in the framework.pl file. My problem in the most basic form is this: the framework.pl file:
package framework; use strict; my $date = "2001-11-12"; sub testcase1 { print $date; }
the test.pl file:
require "framework.pl"; $framework::date = "2001-12-05"; &framework::testcase1; $framework::date = "2001-11-15"; &framework::testcase1;
the output after running this test is 2001-11-122001-11-12. the date is not being changed like I thought it would be. Does anybody know of an easy way for me to access and change frameworks $date variable from within the test.pl? Any help would be greatly appreciated. thanks.

In reply to package/scope question by pbradley

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.