my @foo; sub hello {say "@foo";} @foo = qw[Hello, world!]; hello; { local $foo[1] = "earth!"; hello; } __END__ Hello, world! Hello, earth!