The splice function can replace push when used with the current array size as the starting position. By setting the offset to scalar(@array) (the end of the array), length to 0 (nothing removed), and providing @sublist as the elements to insert, splice behaves exactly like push - appending elements to the array's end.