Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Perl Programming/Data types

From Wikibooks, open books for an open world
<Perl Programming
(Redirected fromPerl Programming/Data Types)
Previous: OperatorsIndexNext: Scalar variables

Perl has four fundamentaldata types: scalars, lists, hashes, and typeglobs.

scalar
is a funny way of saying a single value; it may be a number, a string, or areference.
list
is an ordered collection of scalars. A variable that holds a list is called anarray. Items in a list or array can be accessed by their position in the list; programs can retrieve the first, second, third, etc. item in a list.
hash
is like an array, in that a hash holds many values, but the values are identified by a unique "key", rather than an ordinal index position.
typeglob
is a variable representing an entry within the internal symbol table. It is used to manipulate file handles, and to create references or aliases.

All variables are marked by a leadingsigil, which identifies the data type.The same name may be used for variables of different types, without conflict.

$foo# a scalar@foo# a list%foo# a hash*foo# a typeglob


Previous: OperatorsIndexNext: Scalar variables
Retrieved from "https://en.wikibooks.org/w/index.php?title=Perl_Programming/Data_types&oldid=3676532"
Category:

[8]ページ先頭

©2009-2025 Movatter.jp