Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can put this at the top of <code>Constants.pm</code>:</p> <pre><code>package main; </code></pre> <p>In this case all the variables you define will be in the <code>main</code> namespace:</p> <pre><code>$main::x </code></pre> <p>or if you're feeling brave:</p> <pre><code>package; </code></pre> <p>In this case all the variables you define will be in an empty namespace:</p> <pre><code>$::x </code></pre> <p>Note that using <code>package</code> with no namespace is discouraged, and will apparently be deprecated in some versions of Perl. See the quote below.</p> <hr> <p>Quoting from <code>man perlfunc</code>:</p> <pre> package NAMESPACE package Declares the compilation unit as being in the given namespace. The scope of the package declaration is from the declaration itself through the end of the enclosing block, file, or eval (the same as the "my" operator). All further unqualified dynamic identifiers will be in this namespace. A package statement affects only dynamic variables--including those you've used "local" on--but not lexical variables, which are cre? ated with "my". Typically it would be the first decla? ration in a file to be included by the "require" or "use" operator. You can switch into a package in more than one place; it merely influences which symbol table is used by the compiler for the rest of that block. You can refer to variables and filehandles in other packages by prefixing the identifier with the package name and a double colon: $Package::Variable. If the package name is null, the "main" package as assumed. That is, $::sail is equivalent to $main::sail (as well as to $main'sail, still seen in older code). If NAMESPACE is omitted, then there is no current pack? age, and all identifiers must be fully qualified or lexicals. However, you are strongly advised not to make use of this feature. Its use can cause unexpected behaviour, even crashing some versions of Perl. It is deprecated, and will be removed from a future release. </pre> <hr> <p><strong>Edit:</strong> This question might be helpful as well: <a href="https://stackoverflow.com/questions/193020/how-do-i-use-constants-from-a-perl-module" title="How do I use constants from a Perl module?">How do I use constants from a Perl module?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload