local $a=5; &fun1(); sub func{ print $a; local $a=10; print $a; } print $a; output: 5 10 5 Excepted output: 5 10 10