To answer your first question: a namespace is the "space" in which
identifiers corresponding to a program are stored. These identifiers
include variable names, subroutine names, file handle names,
and mostly anything that you can refer to by name in a Perl
program (or in any other, the concept is not exclusive to Perl).
The main reason to be aware of namespaces is that you cannot have
two things of the same type with the same name in the same namespace,
but you can do that if they are in different namespaces. For example,
each package in Perl defines a new namespace, which is why
different packages can have variables with the same name and not
have them conflict with each other. In perl, the fully qualified
name of a variable or a subroutine is given by prepending its
package name separated by two colons. So for example, if both
packages A and B define a variable v, they are actually two
different variables, with the full names $A::v and $B::v.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.