Social Icons

Pages

Showing posts with label stack. Show all posts
Showing posts with label stack. Show all posts

Wednesday, 24 September 2014

Perl Arrays: push, pop, shift and unshift functions

Perl provides many functions to manipulate and access arrays. These functions makes it very easy to use perl arrays as stacks or queue's. Some of these functions are given below:

POP: 

pop function will remove and return last element of perl arrays. So, this can be used to remove element from stack if array is getting used as stack. pop function will return undef if array is empty