"Perl Programmers Reference Guide (англ.) (программ.) /19.12.1998/ " - читать интересную книгу автора










22/Jul/98 perl 5.005, patch 02 7





PERLDATA(1) Perl Programmers Reference Guide PERLDATA(1)


NNNNAAAAMMMMEEEE
perldata - Perl data types

DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
VVVVaaaarrrriiiiaaaabbbblllleeee nnnnaaaammmmeeeessss

Perl has three data structures: scalars, arrays of
scalars, and associative arrays of scalars, known as
"hashes". Normal arrays are indexed by number, starting
with 0. (Negative subscripts count from the end.) Hash
arrays are indexed by string.

Values are usually referred to by name (or through a named
reference). The first character of the name tells you to
what sort of data structure it refers. The rest of the
name tells you the particular value to which it refers.
Most often, it consists of a single _i_d_e_n_t_i_f_i_e_r, that is, a
string beginning with a letter or underscore, and
containing letters, underscores, and digits. In some
cases, it may be a chain of identifiers, separated by ::
(or by ', but that's deprecated); all but the last are
interpreted as names of packages, to locate the namespace
in which to look up the final identifier (see the Packages
entry in the _p_e_r_l_m_o_d manpage for details). It's possible
to substitute for a simple identifier an expression that
produces a reference to the value at runtime; this is
described in more detail below, and in the _p_e_r_l_r_e_f
manpage.

There are also special variables whose names don't follow
these rules, so that they don't accidentally collide with
one of your normal variables. Strings that match