O'Reilly logo

Sams Teach Yourself Perl in 21 Days, Second Edition by Rafe Colburn, Laura Lemay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required