|
|
| Just another Perl shrine | |
| PerlMonks |
Re: Why no bareword warnings while inside of BEGIN (more)by tye (Cardinal) |
| on Mar 22, 2004 at 23:20 UTC ( #338824=note: print w/ replies, xml ) | Need Help?? |
|
It appears that the test for barewords happens after compiling is finished. The test for undeclared variables also appears to wait until compilation is finished but happens sooner:
Note that I don't even have to type end-of-file there but that the error didn't appear until I finished the BEGIN block. If the infinite loop ever finished, then you'd get the 'bareword' error:
Note that I still didn't have to type end-of-file. And it didn't take until the file was finished being compiled. So it seems like this might be a problem that can be fixed. The BEGIN block can't be run until it is done being compiled. The check for barewords is happening after the block is done being compiled but after the block is run. So the next step is to figure out why it waits (until a subsequent BEGIN block is declared, in the above example) before the check for barewords is done? Updated. - tye
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||