> splice ARRAY, OFFSET, LENGTH, LIST > splice ARRAY, OFFSET, LENGTH > splice ARRAY, OFFSET > This function removes the elements designated by OFFSET and > LENGTH from an array, and replaces them with the elements > of LIST, if any. The function returns the elements removed > from the array. The array grows or shrinks as necessary. If > LENGTH is omitted, the function removes everything from > OFFSET onward.
Да, век живи, век учись :)))
Есть чудесные команды в Perl-е :)
Кстати, по скольку возвращать вырезанный элемент не надо (по условию)
то и мой вариант подойдёт. Единственный вопрос - производительность...
Интересно, какой вариант производительней ?
|