develooper Front page | perl.perl5.porters | Postings from March 2006

Re: [perl #7535] Unfortunate interaction between -0 cmd line arg& (??{CODE}) regex

From:
Eric Promislow
Date:
March 30, 2006 16:20
Subject:
Re: [perl #7535] Unfortunate interaction between -0 cmd line arg& (??{CODE}) regex
Message ID:
442C645B.7080200@activestate.com
Yes, close the ticket.

I repro'ed the bug happens with Perl 5.6.1,
and doesn't happen with Perl 5.8.6, both on Windows.
It seems to have been fixed somewhere before 5.8.3.

- Eric

Dominic Dunlop via RT wrote:
>>[ericp@ActiveState.com - Wed Aug 15 13:44:58 2001]:
> 
> ...
> 
>>I encountered this bug when trying to debug a program with the -0
>>option (which was set by accident).  It turns out that the
>>following code will only compile with either -012 set (on both
>>Linux and Windows, Windows using Active Perl binary build 628),
>>or -0 not given.  Changing $/ to anything other than "\n" in
>>a BEGIN block before the sub will also trigger the compile-time
>>error.
>>
>>Command-line:  no args needed
>>
>>Source:
>>
> 
> =========================================================
> ========
> 
>>#!/usr/bin/perl -0
>>
>>BEGIN { print "before sub\n" }
>>
>>sub unbalanced {
>>    $balanced_brace_re ||= /(??{ $balanced_brace_re })/;
>>    return 'ab{cd{' !~ m/$balanced_brace_re/;
>>}
>>
>>BEGIN { print "after sub\n" }  # not reached
>>
> 
> =========================================================
> ========
> 
>>[Please do not change anything below this line]
>>-----------------------------------------------------------------
>>
>>---
>>This perlbug was built using Perl 5.00503 - Thu Aug 10 15:31:56 EDT
>>2000
>>It is being executed now by  Perl 5.006 - Wed Aug 30 16:29:46 PDT
>>2000.
>>
>>Site configuration information for perl 5.006:
> 
> 
> I cannot reproduce the reported behaviour with perl-5.8.3 or later: the script outputs
> 
> before sub
> after sub
> 
> with no -0 flag, with plain -0, and with -012, either on the command- or on the shebang-
> line. (Running on Mac OS X.)
> 
> Can this ticket be closed?




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About