develooper Front page | perl.perl5.porters | Postings from January 2004

Re: [perl #24774] eval + format - \n = pp_ctl.c assertion

From:
Dave Mitchell
Date:
January 4, 2004 11:59
Subject:
Re: [perl #24774] eval + format - \n = pp_ctl.c assertion
Message ID:
20040104195858.GA29720@fdisolutions.com
On Fri, Jan 02, 2004 at 11:31:46AM +0100, LAUN Wolfgang wrote:
> Festina lente ;-)

Nil illegitimo carborundum?

> Yes, it fixes the assertion failure and all that may come from an
> insufficient allocation. But note that the eval does not return an 
> error, so the format can be run. Observe:
[snip]
> A patch against toke.c (5.8.2) appears to fix this:

Thanks, applied as 22055.

> Finally I'd like to draw your attention to the fact that some NULL
> character *embedded* in the eval'ed string terminates format parsing
> prematurely (possibly because strchr is used in toke.c in scan_formline),
> resulting in an error ("Missing right curly or square bracket"). Any 
> need to fix this, accepting embedded NULLs?

My personal take on this (not that I ever use formats!) is that since
<<EOF preserves \0's, I don't see why formats should discard them.  Would
it be possible to extend your 'pass through control chars' patch to handle
nulls too?

Dave.

-- 
SCO - a train crash in slow motion



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