local

Synopsis

local('$x $y')

Parses the specified string and declares all variables in the string as local variables.

Parameters

'$x $y' - a string containing variable names separated by spaces.

Side Effects / Notes

Examples

global('$x'); sub foo { local('$x'); $x = "foo!"; println("&foo: \$x is $x"); } $x = "bar!"; foo(); println("global: \$x is $x");

&foo: $x is foo! global: $x is bar!

See Also