2009-06-30 04:17:39 +00:00
|
|
|
#
|
|
|
|
# a local variable can shade a global variable
|
|
|
|
#
|
|
|
|
|
2012-11-20 14:44:43 +00:00
|
|
|
@global x;
|
2009-06-30 04:17:39 +00:00
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
x = 1;
|
|
|
|
{
|
2012-11-20 14:44:43 +00:00
|
|
|
@local x;
|
2009-06-30 04:17:39 +00:00
|
|
|
x = 2;
|
|
|
|
{
|
2012-11-20 14:44:43 +00:00
|
|
|
@local x;
|
2009-06-30 04:17:39 +00:00
|
|
|
x = 3;
|
|
|
|
print x;
|
|
|
|
}
|
|
|
|
print x;
|
|
|
|
}
|
|
|
|
print x;
|
|
|
|
}
|
|
|
|
|