Scalar Data and Scalar Variables
Perl, for the most part, has a flexible concept of data types. Unlike languages such as C or Java, which have distinct types for integers, characters, floating-point numbers, and so on (and strict rules for using and converting between types), Perl only distinguishes between two general kinds of data. The first type is scalar data, for single things such as numbers and strings of characters; and the second is list data, for collective things such as arrays. The distinction is not academic; Perl has both scalar and list variables to keep track of, and different constructs in Perl might behave differently depending on whether they operate on scalar or list data, or the context—scalar or list context— in which they ...
Get Sams Teach Yourself Perl in 21 Days, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.