Clear questions and runnable code
get the best and fastest answer
scope of variableby priyo (Novice)
|on May 27, 2013 at 08:58 UTC||Need Help??|
priyo has asked for the
wisdom of the Perl Monks concerning the following question:
I am observing strange behavior of following sub
On 1st call of getValue everything works fine.
On 2nd call of getValue...
print1 prints value of $d from earlier call
print2, print3 prints correct value assigned during latest call.
print4 prints 0 for $d
Please help me to identify the issue. I assumed scope of $d is limited to given call.