perl -wE' sub foo { $_[0]++ } my @a = 1 .. 3; say "@a"; foo(@a); say "@a"; ' 1 2 3 2 2 3