1. Perl
  2. builtin functions
  3. here

push function - added to the end of the array

Use the push function to add an element to the end of a array .

push @array, $value;

Example

This is an example push function. If @nums was (1, 2, 3) then @nums would be (1, 2, 3, 4).

my @nums = (1, 2, 3);
push @nums, 4;

Related Informatrion