Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Why no bareword warnings while inside of BEGIN

by chromatic (Archbishop)
on Mar 22, 2004 at 23:12 UTC ( #338822=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: Re: Why no bareword warnings while inside of BEGIN
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://338822]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2015-07-07 14:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (90 votes), past polls