Summary

Arrays and lists are Perl's collective variables. You can use them to hold an almost unlimited number of scalars, and you can either manipulate them as a whole or manipulate their individual elements. Perl provides easy mechanisms for copying arrays, sorting arrays, combining arrays, and converting data back and forth between scalars and arrays. Also, many of Perl's operators and functions are sensitive to the context that they appear in, and they behave differently depending on whether they are in a scalar or list context.

Get SAMS Teach Yourself Perl in 24 Hours THIRD 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.