Perl | Useful Array functions Last Updated : 04 Aug, 2021 Comments Improve Suggest changes Like Article Like Report In Perl, array is a special type of variable. The array is used to store the list of values and each object of the list is termed as an element. Elements can either be a number, string, or any type of scalar data including another variable. Array in Perl provides various inbuilt functions to perform operations like adding and removing elements from a pre-defined array.Example: Perl #!/usr/bin/perl # Initializing the array @x = ('Java', 'C', 'C++'); # Print the Initial array print "Original array: @x \n"; # Using push() function # Pushing multiple values in the array push(@x, 'Python', 'Perl'); print("Pushing new values...\n"); # Printing the array print "Updated array: @x\n"; # Using pop() function print("\nPopping the last element...\n"); # Prints the value returned by pop print "Value returned by pop: ", pop(@x); # Prints the array after pop operation print "\nUpdated array: @x"; Output: Original array: Java C C++ Pushing new values... Updated array: Java C C++ Python Perl Popping the last element... Value returned by pop: Perl Updated array: Java C C++ Python Some useful array functions are listed below: FunctionDescriptionpush()Used to push a list of values onto the end of the arraypop()Returns the last element of Array passed to it as an argument, removing that value from the arrayshift()Returns the first value in an array, removing it and shifting the elements of the array list to the left by oneunshift()Places the given list of elements at the beginning of an array, shifting all the values to the rightsort()Used to sort a list with or without the use of method of sortingwantarray()Returns True if the currently executing subroutine expects to return a list value, and false if it is looking for a scalar value.exists()Used to check whether an element in an given array or hash exists or notgrep()Used to extract any element from the given array which evaluates the true value for the given regular expressionjoin()Combines the elements of LIST into a single string using the value of VAR to separate each element Comment More infoAdvertise with us Next Article Perl | Useful Array functions A Abhinav96 Follow Improve Article Tags : Perl Perl-function Perl-Arrays Perl-Array-Functions Similar Reads Learn Free Programming Languages In this rapidly growing world, programming languages are also rapidly expanding, and it is very hard to determine the exact number of programming languages. Programming languages are an essential part of software development because they create a communication bridge between humans and computers. No 9 min read Perl Programming Language Perl is a general purpose, high level interpreted and dynamic programming language. Perl supports both the procedural and Object-Oriented programming. Perl is a lot similar to C syntactically and is easy for the users who have knowledge of C, C++. Since Perl is a lot similar to other widely used lan 3 min read Perl | Regex Cheat Sheet Regex or Regular Expressions are an important part of Perl Programming. It is used for searching the specified text pattern. In this, set of characters together form the search pattern. It is also known as regexp. When user learns regular expression then there might be a need for quick look of those 6 min read Perl | split() Function split() is a string function in Perl which is used to split or you can say to cut a string into smaller sections or pieces. There are different criteria to split a string, like on a single character, a regular expression(pattern), a group of characters or on undefined value etc.. The best thing abou 8 min read Perl Tutorial - Learn Perl With Examples How to Run a Perl Program? Let's consider a simple Hello World Program. perl #!/usr/bin/perl # Modules used use strict; use warnings; # Print function print("Hello World\n"); Generally, there are two ways to Run a Perl program- Using Online IDEs: You can use various online IDEs which can b 15+ min read Introduction to Perl Perl is a general-purpose, high level interpreted and dynamic programming language. It was developed by Larry Wall, in 1987. There is no official Full form of the Perl, but still, the most used expansion is "Practical Extraction and Reporting Language". Some of the programmers also refer Perl as the 9 min read Perl | Polymorphism in OOPs Polymorphism is the ability of any data to be processed in more than one form. The word itself indicates the meaning as poly means many and morphism means types. Polymorphism is one of the most important concepts of object-oriented programming languages. The most common use of polymorphism in object 4 min read Perl | Loops (for, foreach, while, do...while, until, Nested loops) Looping in programming languages is a feature which facilitates the execution of a set of instructions or functions repeatedly while some condition evaluates to true. Loops make the programmers task simpler. Perl provides the different types of loop to handle the condition based situation in the pro 7 min read Perl | Arrays In Perl, array is a special type of variable. The array is used to store the list of values and each object of the list is termed as an element. Elements can either be a number, string, or any type of scalar data including another variable. Example: @number = (50, 70, 46); @names = ("Geeks", "For", 6 min read Perl | substr() function substr() in Perl returns a substring out of the string passed to the function starting from a given index up to the length specified. This function by default returns the remaining part of the string starting from the given index if the length is not specified. A replacement string can also be passe 2 min read Like