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

Replies are listed 'Best First'.
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