in reply to how to acces local varialbe

Why do you use local when you don't want the effect of local?

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

Also you have a typo with "func" or "fun1", and the output would really be on one line because "\n" is missing from the prints