in reply to Using an "outer" lexical in a sub?
$n1 is simply a global. It is global to everything (including subroutines and nested blocks) from the point where it is declared onward.
Actually no language I can think of (of the small number I've used) hides global variables from subroutines/functions/class members. Is there a bigger picture here that is leading to your confusion?
Update: Fletch is quite right that I'm playing fast and loose with nomenclature here. C's 'file scope' is the notion I intended by "global". My appologies for any confusion caused.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using an "outer" lexical in a sub?
by Fletch (Bishop) on Nov 01, 2006 at 20:42 UTC |