Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by JayBonci (Curate)
on Mar 22, 2004 at 22:59 UTC ( #338814=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

Okay, so a pared down example of why this is kinda scarry is this:

perl -e "use strict; BEGIN { while(bareword < 1) {1} }"
Cycles forever. No error
perl -e "use strict; BEGIN { while(bareword > 1) {1} }"
Throws the bareword error ...wierd. --jay


    --jaybonci


Comment on Re: Re: Why no bareword warnings while inside of BEGIN
Select or Download Code
Re: Re: Re: Why no bareword warnings while inside of BEGIN
by Limbic~Region (Chancellor) on Mar 22, 2004 at 23:06 UTC
    JayBonci,
    See my post below. The while loop is infinite because 0 < 1. It never enters the loop when 0 > 1. Not throwing the error until after the code is run may or may not be expected behavior as tye points out.

    Cheers - L~R

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2015-07-06 11:41 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 (73 votes), past polls