perlbench
view release on metacpan or search on metacpan
benchmarks/app/perlfunc.pod view on Meta::CPAN
495449554956495749584959496049614962496349644965496649674968496949704971497249734974returns 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
( run in 0.435 second using v1.01-cache-2.11-cpan-49f99fa48dc )