Perl Functions in Alphabetical Order

I’ll list some of the most important built-in functions here, in an alphabetical order. I’ll periodically extend this list, so I’ll be waiting for you to land here again – it is a good idea to bookmark this page and revisit it after awhile. The examples provided for each function cover quite a large area so I hope you’ll get what you are looking for.

Click Below to See the Best

Perl How-to Snippet Collection

and Save Hours of Surfing on Internet!

chompremoves trailing newlines and returns the number of characters removed
chopremoves and returns the last character from a string
chrconverts ASCII or Unicode values into their equivalent characters
cryptallows you to store passwords or other sensitive data using ASCII characters as encrypted strings
definedallows you to check-up whether a function or o variable is defined or not
deleteremoves a key-value pair from a hash; you can delete an individual element of a hash or a hash slice.
eachreturns a two-element list that contains a (key, value) pair from a hash or a (index, value) pair from an array
existsit checks whether a particular hash/array element or a subroutine exists
grepis used to filter a list and to return only those elements that match a certain criteria
hexconverts a hex string into the numerical corresponding value
indexreturns the position of the first occurrence of a substring in a string
joinis used to concatenate the elements of an array or a list into a string, using a separator given by a scalar variable
keysuse this function to get the indices of an array or the keys of a hash
lcconverts all the characters of a string in lowercases and returns the new string
lcfirstconverts the first character of a string in lowercase and returns the new string
lengthreturns the number of characters in a string
maptakes a list and evaluates an expression or block on each element of the list; it returns a list with the results
octconverts an octal string into the numerical corresponding value
ordconverts a character to its ASCII or Unicode numeric value
packconverts a list of values into a template string, enabling you to write data in a format that would be compatible with other program languages such as C; practically, it packs the list of values into a binary structure that will be returned as a string
popremoves and returns the last element of an array; the size of the array decreases by 1
pushis used to append a list onto the end of an array
q/STRING/singly quote a string
qq/STRING/doubly quote a string
qw/STRING/uses whitespace separator to split an expression passed to it into a list of elements and returns that list
reversein a scalar context, it concatenates the elements of a list in a string and returns the string with all the characters in an opposite order; in a list context, it returns the list in the reversed order
rindexreturns the position of the last occurrence of a substring in a string
scalarenables you to evaluate an expression in a scalar context and returns the value of that expression
shiftremoves and returns the first element of an array, shortening the dimension of the array with 1
sortsorts a LIST by an alphabetical or numerical order and returns the sorted list value
spliceis used to remove, replace or add elements from or to an array
splitallows you to break up a string into an array or a list, by using a specific pattern
sprintfreturns a string formatted by the usual printf conventions of the C library function sprintf
substrextracts a substring from a string and returns it
tr///transliterates a string
ucconverts all the characters of a string in uppercases and returns the new string
ucfirstconverts the first character of a string in uppercase and returns the new string
undefreturns an undefined value, freeing up the memory used by the variable arguments passed to it
unpackit expands a binary string into a list of values by using a template format
unshiftinserts a list at the beginning of an array and returns the total number of elements of the array
valuesuse this function to get the values of an array or a hash

A-N-Y-O-N-E Can Learn and Master Perl!
And That Includes YOU!

Check these how-to tutorial eBooks (PDF format):

Table of Contents:

A Perl Script
Install Perl
Running Perl
Perl Data Types
Perl Variables
Perl Operators
Perl Lists
Perl Arrays
    Array Size
    Array Length
Perl Hashes
Perl Statements
    Perl if
    Perl unless
    Perl switch
    Perl while
    Perl do-while
    Perl until
    Perl do-until
    Perl for
    Perl foreach
Built-in Perl Functions
    Functions by Category
        String Functions
        Regular Expressions and Pattern Matching
        List Functions
        Array Functions
        Hash Functions
        Miscellaneous Functions
    Functions in alphabetical order (more)

return to Perl Basics

Would you like to create your own website like this one?
Hit the Alarm Clock!

Site Build It!