use v5.14; sub foo { say $::hello; } sub bar { local $::hello = "Goodbye"; foo(); } $::hello = "Hello"; bar(); say $::hello;