my ($i , $j); $i = 1; $j = $i - 1; print "before sub value of i=$i\n"; sub abc { $i = $i+1; print "inside sub $i\n"; $j = $j+1; } abc(); print "after sub $i\n";