use strict; use warnings; sub splice_insert { splice( @_, 2, 2, ('a' .. 'c') ); print "@_ # after splice\n"; $_ = '.' for @_; print "@_ # after for loop\n"; } my @a = ( 0 .. 6 ); print "@a # before subroutine\n"; splice_insert(@a); print "@a # after subroutine\n"; #### 0 1 2 3 4 5 6 # before subroutine 0 1 a b c 4 5 6 # after splice . . . . . . . . # after for loop . . 2 3 . . . # after subroutine