sub fun2{
my $var2 = 10;
my sub fun1{
print"$var2";
$var2++;
}
fun1();
print "$var2";
}
fun2();
I want to print 10 and 11, this code gives error "Experimental "my" subs not enabled at source_file", if I remove "my" keyword from "my sub fun1" then it gives error "Variable "$var2" will not stay shared at source_file.pl line"
How can we allow the inner sub to modify the data of the outer sub?