Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL push Function
Syntax
Definition and Usage
Pushes the values in LIST onto the end of the list ARRAY. Used with pop to implement stacks.
Return Value
Example
Try out following example:
#!/usr/bin/perl -w
$, = ",";
@array = ( 1, 2 );
print "Before pusing elements @array \n";
push(@array, (3, 4, 5));
print "After pusing elements @array \n";
|
It will produce following results:
Before pusing elements 1 2
After pusing elements 1 2 3 4 5
| |
|

|
|
|