delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/03/16:29:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sun, 3 Feb 2002 16:29:21 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: bug in cygwin perl 5.6.1?
Message-ID: <20020203212921.GA31365@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <LAW2-OE14zjwakzNFfh00000a63 AT hotmail DOT com> <3C5DB3B8 DOT 25163 DOT 219A3CC AT localhost>
Mime-Version: 1.0
In-Reply-To: <3C5DB3B8.25163.219A3CC@localhost>
User-Agent: Mutt/1.3.23.1i

On Sun, Feb 03, 2002 at 10:03:36PM +0100, Gerrit P. Haase wrote:
>Am 2 Feb 2002 um 17:58 hat Rhet Turnbull geschrieben:
>
>>Gerrit P. Haase wrote:
>>> Why?  Where is docu about this?
>>
>>The perl documentation for $^S in the perlvar manpage states:
>>
>>$^S     Current state of the interpreter.  Undefined if
>>        parsing of the current module/eval is not finished
>>        (may happen in $SIG{__DIE__} and $SIG{__WARN__}
>>        handlers).  True if inside an eval(), otherwise
>>        false.
>>
>>The "True if inside an eval(), otherwise false" is what I was getting at.  I
>
>Previous mail:
>
>>>>There seems to be a bug in Cygwin's perl (5.6.1). The
>>>>following code:
>>>>
>>>>perl -e 'print $^S || 0;eval {print $^S || 0}; print
>>>>$^S || 0;'
>>>>
>>>>should produce '010'
>
>>ran into this since I was writing a custom SIG{__DIE__} handler (which needs
>>to know if you're inside an eval where die is an exception catching
>>mechanism or in normal code where die means to exit with error.)  The bug is
>>that after executing an eval(), $^S stays true even though it should be
>>false outside the scope of the eval.
>
>Hmmm, I'm still confused a little.  Isn't '010' as TRUE as '011'?

There are three numbers here '0', '1', '1'.  The third number should be '0'.

Maybe this would help:

perl -e 'print $^S || 0, "\n";eval {print $^S || 0, "\n"}; print $^S || 0, "\n";'

This should print:

0
1
0

Instead, it prints:

0
1
1

This indicates, to me, that perl is not resetting the "I'm in an eval", probably
when all of the statements are on the same line, or something.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019