In addition, subroutines are named with an initial '&',
though this is optional when it's otherwise unambiguous
(just as "do" is often redundant in English). Symbol
table entries can be named with an initial '*', but you
don't really care about that yet.
Every variable type has its own namespace. You can,
without fear of conflict, use the same name for a scalar
variable, an array, or a hash (or, for that matter, a
filehandle, a subroutine name, or a label). This means
that $$$$ffffoooooooo and @@@@ffffoooooooo are two different variables. It also
means that $$$$ffffoooooooo[[[[1111]]]] is a part of @@@@ffffoooooooo, not a part of $$$$ffffoooooooo.
This may seem a bit weird, but that's okay, because it is
weird.
Since variable and array references always start with '$',
'@', or '%', the "reserved" words aren't in fact reserved
with respect to variable names. (They ARE reserved with
respect to labels and filehandles, however, which don't
have an initial special character. You can't have a
filehandle named "log", for instance. Hint: you could say
ooooppppeeeennnn((((LLLLOOOOGGGG,,,,''''llllooooggggffffiiiilllleeee'''')))) rather than ooooppppeeeennnn((((lllloooogggg,,,,''''llllooooggggffffiiiilllleeee'''')))).
30/Jan/96 perl 5.002 with 1
PERLDATA(1) User Contributed Perl Documentation PERLDATA(1)
Using uppercase filehandles also improves readability and
protects you from conflict with future reserved words.)
Case _I_S significant--"FOO", "Foo" and "foo" are all
different names. Names that start with a letter or
underscore may also contain digits and underscores.
It is possible to replace such an alphanumeric name with
an expression that returns a reference to an object of
that type. For a description of this, see the _p_e_r_l_r_e_f
manpage.
Names that start with a digit may only contain more
digits. Names which do not start with a letter,
underscore, or digit are limited to one character, e.g.
$$$$%%%% or $$$$$$$$. (Most of these one character names have a
predefined significance to Perl. For instance, $$$$$$$$ is the
current process id.)
CCCCoooonnnntttteeeexxxxtttt
The interpretation of operations and values in Perl
sometimes depends on the requirements of the context
around the operation or value. There are two major
contexts: scalar and list. Certain operations return list
values in contexts wanting a list, and scalar values
otherwise. (If this is true of an operation it will be
mentioned in the documentation for that operation.) In
other words, Perl overloads certain operations based on
whether the expected return value is singular or plural.
(Some words in English work this way, like "fish" and
"sheep".)
In a reciprocal fashion, an operation provides either a
scalar or a list context to each of its arguments. For