James Edward Gray II <[EMAIL PROTECTED]> wrote:
: 
[snipped code]
: 
: Interesting things to note about the above:  All three @strings are
: bad perl code and don't  compile.  Warnings are disabled when I run
: the eval() and thus, not a part of the equation.  (The script runs 
: identically if they are left on.)  We're not catching eval()'s
: return value here, so it's not part of the equation either.  Note 
: how similar the second and third string are as well.
: 
: When I run this code, I get:
: 
: Code:  my $bad_syntax = ;
: 
: Disabling warnings...
: Calling eval()...
: eval() complete.
: 
: Handling error...
: Caught error:  syntax error at (eval 1) line 1, at EOF
: 
: Code:  'a poorly 'nested' string'
: 
: Disabling warnings...
: Calling eval()...
: eval() complete.
: 
: Handling error...
: Caught error:  Bad name after nested' at (eval 2) line 1.
: 
: Code:  'a poorly 'nested::test' string'
: 
: Disabling warnings...
: Calling eval()...
: Bareword found where operator expected at (eval 3) line 1, near "'a 
: poorly 'nested::test"
:          (Missing operator before nested::test?)
: String found where operator expected at (eval 3) line 1, near 
: "nested::test' string'"

    I assume you are referring to these lines above which are not
down there in the caught error part of the report.


: eval() complete.
: 
: Handling error...
: Caught error:  syntax error at (eval 3) line 1, near "'a poorly 
: 'nested::test"
: 
: __END__
: 
: The first two results are what I expect/want.  The third string, a 
: super simplified example of the typo I fed my server this morning, 
: throws errors inside the eval() call and yet the script keeps on 
: trucking along!
: 
: Can anyone explain to me what's going on here?

    I think(?) those lines are out of order because $| has not been
set. Add $|++; to the top of the script and see if they don't drop to
the error handler. They do on my Windows 5.8.3 setup.


HTH,

Charles K. Clarkson
-- 
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to