Howdy!
That would be spot on!
The call to _initialize occurs at compile time, but the initialization part
of the "our" statement occurs at run time.
| [reply] |
| [reply] |
The variable $initialized was declared by the my $initialized. This made it known the parser so when the source code farther down saw it, it incremented the variable. At the time, the value was still undefined because while the variable had been declared, the = 0; hadn't run yet. So now $variable = 1 after the BEGIN. Now that the file is finished being parsed, execution starts at the top so now you run $initialized = 0;. $variable := undef -> 1 -> 0
| [reply] [d/l] [select] |
OK, I may be focussing too closely hereif it encounters a subroutine or a block called BEGIN while parsing...
what happens to everything it has parsed upto the BEGIN block - does it forget about it till the begin has been completed. The doc says 'parsed' - does that mean entries in the symbol table etc have been made too ?
| [reply] |