Perl Array Functions
These sites are FOR SALE: miscperlinfo.com, mpihowto.com!
If you are interested, please use my Contact page.
The Perl array functions are one of the most important category of the built-in Perl functions. As you know, three data types are available in the Perl language: scalars, arrays and hashes.
A scalar, which represents the fundamental type of Perl data, can be a string, a number or a reference. When you group together two or more scalars, you have a list.
If you want to refer a list throughout a Perl script, you need an array variable, represented in Perl by an identifier preceded by the @ symbol.
If some of the elements of an array are references to other arrays or structures, we say that we have a multidimensional array.
The Perl language supplies a lot of functions to manipulate arrays. Every time you call a Perl array function, you must distinguish between a simple array and a multidimensional one.
For instance, if you have an array which has as elements references to other arrays or hashes and if you want to delete all its elements, you need to step down through all its sub-arrays and delete their elements too.
Follow the below links to see how to use the Perl array functions.
||removes and returns the last element of an array; the size of the array decreases by 1
||appends the elements of a list to an array; the size of the array increases by the size of the list
||removes and returns the first element of an array, reducing the number of the array elements by one
||removes a subarray from an array and eventually replaces it with another array
||inserts a value or a list of values at the beginning of an array and returns the new total number of the array’s elements
Table of Contents:
A Perl Script
Perl Data Types
Built-in Perl Functions
Functions by Category
Regular Expressions and Pattern Matching
Array Functions (more)
Functions in alphabetical order
return from Perl Array Functions to Perl Basics
Would you like to create your own website like this one?
Hit the Alarm Clock!