in reply to popping, shifting or splicing an array???
Depends where in the array you want to cut stuff out and if you're rmoving a single element at a time or multiple elements... splice is the most general (i think any shift or pop can be re-written as a splice), whereas shift and pop only remove a single element, and only from the very front or back (respectively) of the array.
perldoc -f splice
perldoc -f shift
perldoc -f pop
so, to summarize:
if only one element from front, then shift
else if only one element from back, then pop
else splice
(Note also there are probablly different ways besides splice as well -- e.g. could probably rewrite using map/grep/array slices)
perldoc -f splice
perldoc -f shift
perldoc -f pop
so, to summarize:
if only one element from front, then shift
else if only one element from back, then pop
else splice
(Note also there are probablly different ways besides splice as well -- e.g. could probably rewrite using map/grep/array slices)
In Section
Seekers of Perl Wisdom