You don't need to include anything, packages are always there for you! By default, you *are* in package main unless you specify otherwise. An example will be hopefully useful:
poletti@PolettiX:~/sviluppo/perl$ nl mikasue.pl 1 #!/usr/bin/perl 2 use strict; 3 use warnings; 4 { # scope reduction 5 our $MW = "Hello, mikasue!"; 6 print "\$MW is '$MW'\n"; 7 print "Current package is ", __PACKAGE__, "\n"; 8 print "\$main::MW is '$main::MW'\n"; 9 } # end of "our" scope 10 package Whatever; 11 no strict; # note: no strict here! 12 print "\$MW is '$MW'\n"; 13 print "Current package is ", __PACKAGE__, "\n"; 14 print "\$main::MW is '$main::MW'\n"; poletti@PolettiX:~/sviluppo/perl$ perl mikasue.pl Name "Whatever::MW" used only once: possible typo at mikasue.pl line 1 +2. $MW is 'Hello, mikasue!' Current package is main $main::MW is 'Hello, mikasue!' Use of uninitialized value in concatenation (.) or string at mikasue.p +l line 12.$MW is '' Current package is Whatever $main::MW is 'Hello, mikasue!'
Note that you have two warnings regarding line 12. The first one is given during the compilation phase, and refers to the misterious "Whatever::MW" variable. This stems from the fact that, when not using strict, every variable you use actually is the corresponding package variable (in the current package). In line 9 we're entering package "Whatever", so there you are. The second warning happens at run time, when you try to print the content of this variable, that is undefined.

As you can see (line 7), by default we're in package main.

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

In reply to Re^3: Sharing Across Packages by polettix
in thread Sharing Across Packages by mikasue

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.