in reply to Re: Why no bareword warnings while inside of BEGIN
in thread Why no bareword warnings while inside of BEGIN
Also, IIRC, the strict and warning pragma's are imported *after* the BEGIN block.
There's one way to find out :)
$ perl use strict; BEGIN { $x = 'y'; $$x = 1; print $y } Global symbol "$x" requires explicit package name at - line 2. Global symbol "$x" requires explicit package name at - line 2. Global symbol "$y" requires explicit package name at - line 2. BEGIN not safe after errors--compilation aborted at - line 2.
As it turns out, use calls reduce to BEGIN blocks and BEGIN blocks fire in order of encountering.
|
---|
In Section
Seekers of Perl Wisdom