pop() function in Perl returns the last element of Array passed to it as an argument, removing that value from the array. Note that the value passed to it must explicitly be an array, not a list.
undef if list is empty else last element from the array.
Popped element is 40 Resultant array after pop(): 10 20 30
Popped element is Best Resultant array after pop(): Geeks For Geeks
- Perl | Useful Array functions
- Perl | Reverse an array
- Perl | Array Slices
- Perl | cos() Function
- Perl | ord() Function
- Perl | int() function
- Perl | sin() Function
- Perl | oct() Function
- Perl | abs() function
- Perl | each() Function
- Perl | exp Function
- Perl | log() Function
- Perl | hex Function
- Perl | tell() Function
- Perl | chr() Function
- Perl | uc() Function
- Perl - Creating a Hash from an Array
- Perl | Getting the Number of Elements of an Array
- Perl | length() Function
- Perl | substr() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.