Thanks, tilly. I think what confused me was that I've been viewing the package as a lexical scope that could span files. Now I see that it is only a namespace and that the largest lexical scope in Perl is a file. Do I have that right?

To illustrate what (I think) tilly is saying (because I find it somewhat abstract):

#--------------------------------------------------------- # Foo_1.pm use strict; use warnings; package Foo; my $HELLO='elloHay'; our $GOODBYE ='oodbyeGay'; sub hello { "hi! $HELLO -> $GOODBYE"; } 1; #--------------------------------------------------------- # Foo_2.pm use strict; use warnings; package Foo; # You are right Tilly - "our" doesn't reset $GOODBYE # and strict won't complain about an unqualified our # variable so long as we declare it our $GOODBYE; print "GOODBYE=$GOODBYE\n"; # no compiler complaints from above line # outputs: GOODBYE=oodbyeGay $Foo::HELLO='Bonjour'; #this is OK $Foo::GOODBYE='Au revoir'; #this is OK print hello() . "Hello=$Foo::HELLO, Goodbye=$Foo::GOODBYE\n"; # in the hello() sub HELLO and GOODBYE are both unqualified. # the my variable(HELLO) retains its old value, but the our # variable (GOODBYE) reflects the new value because with # or without qualification it is global (in the package table) #outputs: hi! elloHay -> Au revoir: Hello=Bonjour Goodbye=Au revoir #NOT hi! elloHay -> oodbyeGay: Hello=Bonjour Goodbye=Au revoir #NOR hi! Bonjour -> Au revoir: Hello=Bonjour Goodbye=Au revoir

So, no bug.


In reply to Re^3: Acceptable way to divide a long module into multiple files by ELISHEVA
in thread Acceptable way to divide a long module into multiple files by somekindafreak

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.