=over =item package NAMESPACE =item package NAMESPACE VERSION X X X X =item package NAMESPACE BLOCK =item package NAMESPACE VERSION BLOCK X X X X Declares the BLOCK or the rest of the compilation unit as being in the given namespace. The scope of the package declaration is either the supplied code BLOCK or, in the absence of a BLOCK, from the declaration itself through the end of current scope (the enclosing block, file, or C). That is, the forms without a BLOCK are operative through the end of the current scope, just like the C, C, and C operators. All unqualified dynamic identifiers in this scope will be in the given namespace, except where overridden by another C declaration or when they're one of the special identifiers that qualify into C, like C, C, C, and the punctuation variables. A package statement affects dynamic variables only, including those you've used C on, but I lexically-scoped variables, which are created with C, C, or C. Typically it would be the first declaration in a file included by C or C. You can switch into a package in more than one place, since this only determines which default symbol table the compiler uses for the rest of that block. You can refer to identifiers in other packages than the current one by prefixing the identifier with the package name and a double colon, as in C<$SomePack::var> or C. If package name is omitted, the C
package as assumed. That is, C<$::sail> is equivalent to C<$main::sail> (as well as to C<$main'sail>, still seen in ancient code, mostly from Perl 4). If VERSION is provided, C sets the C<$VERSION> variable in the given namespace to a L object with the VERSION provided. VERSION must be a "strict" style version number as defined by the L module: a positive decimal number (integer or decimal-fraction) without exponentiation or else a dotted-decimal v-string with a leading 'v' character and at least three components. You should set C<$VERSION> only once per package. See L for more information about packages, modules, and classes. See L for other scoping issues. =back