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"; #### before sub value of i=1 inside sub 2 after sub 2