Not specifically an array or hash function, but provides a convenient way to test whether an array or hash element has a defined value.
@
array[
index1,
. . . ]
@
hash{
key1,
key2,
. . . }
lku must be an array lookup like $
array[
index]
or expr->[
index]
, or a hash key lookup like $
hash{
key}
or expr->{
key}
. Deletes the specified elements from the array or hash. Returns aliases to the deleted values. Deleting the last element(s) of an array will shorten the array.
In list context, returns a two-element list consisting of the key and an alias to the value for the next element of the hash. In scalar context, returns only the key. Entries are returned in an apparently random order. After all values of the hash have been returned, an empty list is returned. The next call to each after that will start iterating again. A call to keys or values will reset the iteration.
lku must be an array a hash lookup (see delete above). Checks whether the specified array element or hash key exists.
Evaluates expr or block for each element of the list, locally aliasing $_
to the element. In list context, returns the list of elements from list for which expr or block returned true. In scalar context, returns the number of such elements.
,
listReturns the string formed by inserting expr between all elements of list and concatenating the result.
In list context, returns a list of all the keys of the named hash. In scalar context, returns the number of elements of the hash. Can be assigned to, to preextend the hash.
,
listEvaluates expr or block for each element of the list, locally aliasing $_
to the element. Returns the list of results.
@
array ]Pops off and returns the last value of the array. If @
array is omitted, pops @_
if inside a subroutine; otherwise pops @ARGV.
@
array,
listPushes the values of the list onto the end of the array. Returns the length of the resulting array.
In list context, returns the list in reverse order. In scalar context, concatenates the list elements and returns the reverse of the resulting string.
@
arrayReturns the number of elements in the array.
%
hashReturns true if there are keys in the hash.
@
array ]Shifts the first value of the array off and returns it, shortening the array by 1 and moving everything down. If @
array is omitted, shifts @_
if inside a subroutine; otherwise shifts @ARGV.
Sorts the list and returns the sorted list value. subroutine, if specified, must return less than zero, zero, or greater than zero, depending on how the elements of the list are to be ordered.
subroutine may be the name of a user-defined routine, a variable containing that name, or a block. If the subroutine has been declared with a prototype of ($$),
the values to be compared are passed as normal parameters; otherwise, they are available to the routine as package global variables $a
and $b.
@
array,
offset [ ,
length [ ,
list ] ]Removes the elements of @
array designated by offset and length, and replaces them with list (if specified). Returns the elements removed. If offset is negative, counts from the end of the array.
,
expr† [ ,
limit ] ] ]Uses pattern to split expr (a string) into a list of strings, and returns it. If limit is a positive number, splits into at most that number of fields. A negative value indicates the maximum number of fields. If limit is omitted, or 0, trailing empty fields are not returned. If pattern is omitted, splits at the whitespace (after skipping any leading whitespace). If not in list context, returns number of fields and splits to @_
.
@
array, listPrepends list to the front of the array. Returns the length of the resultant array.
%
hashReturns a list consisting of aliases to all the values of the named hash.