sub test { my ($val) = @_; $$val = "new_value"; } { my $var = "old value"; print("$var\n"); test(\$var); print("$var\n"); }