CARVIEW |
Select Language
HTTP/2 200
server: nginx
content-type: text/html;charset=UTF-8
content-encoding: gzip
content-security-policy: default-src 'self'; connect-src 'self' *.google-analytics.com; img-src 'self' data: www.google-analytics.com www.googletagmanager.com; script-src 'self' 'unsafe-inline' www.google-analytics.com www.googletagmanager.com; style-src 'self'; report-uri /csp-reports
accept-ranges: bytes
age: 21174
date: Mon, 28 Jul 2025 11:11:22 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210097-BOM
x-cache: HIT
x-cache-hits: 0
x-timer: S1753701083.848460,VS0,VE1
vary: Accept-Encoding
strict-transport-security: max-age=31557600
content-length: 2960
push - Perldoc Browser
- #push ARRAY,LIST
-
Adds one or more items to the end of an array.
my @animals = ("cat"); push(@animals, "mouse"); # ("cat", "mouse") my @colors = ("red"); push(@colors, ("blue", "green")); # ("red", "blue", "green")
Returns the number of elements in the array following the completed
push
.my $color_count = push(@colors, ("yellow", "purple")); say "There are $color_count colors in the updated array";
Starting with Perl 5.14, an experimental feature allowed
push
to take a scalar expression. This experiment has been deemed unsuccessful, and was removed as of Perl 5.24.
Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via the GitHub issue tracker or email regarding any issues with the site itself, search, or rendering of documentation.
The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the Perl issue tracker, the mailing list, or IRC to report any issues with the contents or format of the documentation.