Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 romping around the Monastery: (8)
As of 2014-08-28 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls