Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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: <3C5DB3B8 DOT 25163 DOT 219A3CC AT localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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/