Home
FREE Newsletter
Perl How To
Perl Books
Perl Basics
Perl Editors
Perl Modules
Perl Database
Net Programming
Sitemap
About Me
Contact Me
Blog
 

Perl Functions by Category



NEW!!!

Check my new resource:    Perl How To Tutorial eBooks



I described on my site some of the most important buit-in functions. They are presented here grouped by categories. Stay tuned for more.

Perl String Functions

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 corresponding characters
cryptallows you to store passwords or other sensitive data using ASCII characters as encrypted strings
hexconverts a hex string into the numerical corresponding value
indexreturns the position of the first occurrence of a substring in a string
lcconverts all the characters of a string in lowercase and returns the new string
lcfirstconverts the first character of a string in lowercase and returns the new string
lengthreturns the number of bytes/characters in a string
octconverts an octal string into the numerical corresponding value
ordconverts a character into its ASCII/Unicode corresponding value
packconverts a list into a string, according to a user-defined template (ex. a binary representation of a list)
qsingly quote a string
qqdoubly quote a string
reversein scalar context, concatenates the elements of a list and returns a string value with all characters in the opposite order
rindexis similar to index, but returns the position of the last occurrence of a substring in a string
sprintfemulates the C sprintf function
substrextracts a substring from a string and returns it
trtransliterate 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


Check my new How To Tutorial eBooks (PDF format):

to see a lot of fully commented examples that help you use the Perl statements and the Perl built-in functions in your scripts.

Perl Array Functions

popremoves and returns the last element of an array; the size of the array decreases by 1
pushappends the elements of a list to an array; the size of the array increases by the size of the list
shiftremoves and returns the first element of an array, reducing the number of the array elements by one
spliceremoves a subarray from an array and eventually replaces it with another array
unshiftinserts a value or a list of values at the beginning of an array and returns the new total number of the array’s elements


Perl List Functions

grepis used as a filter to extract those elements of a list for which an expression (or a regular expression) is evaluated true; it returns the sublist of the elements that passed the filter test
joinwith this function you can merge any number of strings you want; you can specify with what token you want to delimitate the strings; in other words you can concatenate all the string elements of a list into a string, using a separator
maptakes a list and evaluates an expression or block on each element of the list; it returns a list with the results
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
qwthis 'quote word' function is used to generate a list of words and returns the list containing the words; it automatically quotes the strings for you
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
sortsorts a list in a specific order and returns the sorted list
splitconverts a string into a list and returns that list; the words of the string must be delimitated by a separator


Perl Hash Functions

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


Perl Miscellaneous Functions

definedit tests whether a value, variable or function is defined; using it on an entire array reports if the array has ever been allocated
scalarenables you to evaluate an expression in a scalar context and returns the value of that expression
undefit removes a variable or function definition; if you use it for an entire array, this function will clear the array and free up the system memory allocated for it



Subscribe now to my FREE newsletter
(regarding tips and tricks to manipulate multidimensional
arrays and hashes in Perl)

and you'll receive a link to download for FREE my Perl chomp Function Tutorial eBook, it's a bonus for you and I hope you'll enjoy it. You can see its Table of Contents here (if you subscribe to my free newsletter, you don't have to pay for this eBook or use your paypal account).


Don't forget to check my new How To Tutorial eBooks (PDF format):

to see a lot of fully commented examples that help you use the Perl statements and the Perl built-in functions in your scripts.






NEW!!!

Do you want more information about the basic Perl topics?

Check my new "Perl How To" Tutorial eBooks page where I'll answer the most frequent questions regarding some topics :


Perl How To Tutorial eBooks


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
        List Functions
        Array Functions
        Hash Functions
        Miscellaneous Functions
    Functions in alphabetical order
        chomp
        chop
        chr
        crypt
        defined
        delete
        each
        grep
        hex
        index
        join
        lc
        lcfirst
        length
        map
        oct
        ord
        pack
        pop
        push
        q
        qq
        qw
        reverse
        rindex
        scalar
        shift
        sort
        splice
        split
        sprintf
        substr
        tr
        uc
        ucfirst
        undef
        unshift

return to Perl Basics



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

Site Build It!


footer for perl functions by category page