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

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

Dave Mitchell
January 4, 2004 11:59
Re: [perl #24774] eval + format - \n = pp_ctl.c assertion
Message ID:
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:
> 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?


SCO - a train crash in slow motion Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About