in reply to Confusion about BEGIN block
Your confusion is with respect to the scoping that our creates. ...yes, scoping, believe it or not. See the documentation for our.
our is indeed creating those symbols, and they live for the duration of the script (unless you delete them from the package-global symbol table). But for the purposes of strictures, their access is limited to the enclosing block in which they were created. You could still get at them outside the BEGIN block by using their fully qualified name (ie, $main::bb), since this doesn't raise the red flag for strictures, or declare them within the BEGIN block via the "use vars" pragma instead of our.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Confusion about BEGIN block
by Sandy (Curate) on Oct 15, 2004 at 15:54 UTC | |
by davido (Cardinal) on Oct 15, 2004 at 16:14 UTC | |
by borisz (Canon) on Oct 15, 2004 at 15:59 UTC |