in reply to how to acces local varialbe

Don't use local if you don't understand what it does. Leaving out local makes your code work as you expect. In most cases, it is better to pass values as paramters to a function instead of using and modifying global variables.

Also, it helps you to get better responses if you actually test your code before you post it. You tried to call a subroutine named fun1 but only declared a subroutine func.

Replies are listed 'Best First'.
Re^2: how to acces local varialbe
by Anonymous Monk on Feb 09, 2011 at 13:50 UTC
    Sometime it is an actual typo, sometimes its part of the test (can you recognize a runtime error). Sometimes its part of class fun, and sometimes its cruel interviewer trick.