Perl Programming/Keywords/splice

The splice keyword
The splice command removes the elements designated by OFFSET and LENGTH to replace them with the elements of LIST, if any. After deletion, the array grows or shrinks as necessary. If OFFSET is negative, it starts OFFSET elements away from the end of the array. Without LENGTH, everything from <tt>OFFSET</tt> onward is removed. If <tt>LENGTH</tt> is negative, everything from <tt>OFFSET</tt> onward is removed except <tt>-LENGTH</tt> at the array end. Without both <tt>LENGTH</tt> and <tt>OFFSET</tt>, all the array contents are removed. If <tt>OFFSET</tt> is past the end of the array and a <tt>LENGTH</tt> was given, Perl issues a warning, and splices at the end of the array.

<tt>splice</tt> can be used to implement n-ary queue processing. With Perl 5.14.0, <tt>splice</tt> can also accept an <tt>EXPRESSION</tt> with an reference to an unblessed array.

Examples
returns