use strict; use warnings; my $x = 10; &function( \$x ); # if I change $x = 5 print $x; # $x = 10 sub function { my $x = $_[0]; $$x = 5; } # End function subroutine