Perl push Function
This function pushes the values in LIST onto the end of the list ARRAY. Used with pop to implement stacks.
Following is the simple syntax for this function:
push ARRAY, LIST
This function returns number of elements in new array.
Following is the example code showing its basic usage:
#!/usr/bin/perl -w $, = ","; @array = ( 1, 2 ); print "Before pushing elements @array \n"; push(@array, (3, 4, 5)); print "After pushing elements @array \n";
When above code is executed, it produced following result
Before pushing elements 1 2 After pushing elements 1 2 3 4 5