Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 wandering the Monastery: (6)
As of 2014-10-25 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (147 votes), past polls