perlbench
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
benchmarks/app/perlfunc.pod view on Meta::CPAN
returns the last element removed, or C<undef> if no elements are
removed. The array grows or shrinks as necessary.
If OFFSET is negative then it starts that far from the end of the array.
If LENGTH is omitted, removes everything from OFFSET onward.
If LENGTH is negative, removes the elements from OFFSET onward
except for -LENGTH elements at the end of the array.
If both OFFSET and LENGTH are omitted, removes everything. If OFFSET is
past the end of the array, perl issues a warning, and splices at the
end of the array.
The following equivalences hold (assuming C<< $[ == 0 and $#a >= $i >> )
push(@a,$x,$y) splice(@a,@a,0,$x,$y)
pop(@a) splice(@a,-1)
shift(@a) splice(@a,0,1)
unshift(@a,$x,$y) splice(@a,0,0,$x,$y)
$a[$i] = $y splice(@a,$i,1,$y)
Example, assuming array lengths are passed before arrays:
sub aeq { # compare two list values
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.220 second using v1.00-cache-2.02-grep-82fe00e-cpan-da92000dfeb )