Download presentation
Presentation is loading. Please wait.
1
PERL How to Use the Array Push() Function
HeelpBook © 12/05/2019 PERL How to Use the Array Push() Function Source: Link Posted By: HeelpBook Permalink: Link 12/05/2019 How-Tos <<
2
HeelpBook © 12/05/2019 $TOTAL = VALUES); Perl's push() function is used to push a value or values onto the end of an array, which increases the number of elements. The new values then become the last elements in the array. It returns the new total number of elements in the array. 12/05/2019 >> How to Use the Array Push() Function How-Tos <<
3
HeelpBook © 12/05/2019 It's easy to confuse this function with unshift(), which adds elements to the beginning of an array. @myNames = ('Larry', 'Curly'); 'Moe'); 12/05/2019 >> How to Use the Array Push() Function How-Tos <<
4
HeelpBook © 12/05/2019 Picture a row of numbered boxes, going from left to right. The push() function would push the new value or values on to the right side of the array, and increase the elements. In the examples, the value 'Curly', 'Moe'). 12/05/2019 >> How to Use the Array Push() Function How-Tos <<
5
HeelpBook © 12/05/2019 The array can also be thought of as a stack - picture of a stack of numbered boxes, starting with 0 on the top and increasing as it goes down. The push() function would push the value into the bottom of the stack, and increase the elements. @myNames = ( 'Larry', 'Curly' ); 'Moe'); 12/05/2019 >> How to Use the Array Push() Function How-Tos <<
6
HeelpBook © 12/05/2019 You can push multiple values onto the array directly: @myNames = ('Larry', 'Curly'); ('Moe', 'Shemp')); Or by pushing on an array: @myNames = ('Larry', 'Curly'); @moreNames = ('Moe', 12/05/2019 >> How to Use the Array Push() Function How-Tos <<
7
HeelpBook © 12/05/2019 That’s all Folks Come visit us on to find and read more documents and guides… AND / OR Subscribe to our feed RSS: Link Or see&read us on FeedBurner: Link { 12/05/2019 >> How to Use the Array Push() Function How-Tos <<
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.