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

Re: [PATCH] 'perl -v' fails if local_patches contains code snippets

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
May 26, 2004 08:34
Subject:
Re: [PATCH] 'perl -v' fails if local_patches contains code snippets
Message ID:
20040526173123.6b38e9c1@localhost
Nicholas Clark wrote:
> On Wed, May 26, 2004 at 04:24:03PM +0100, Alan Burlison wrote:
> > If the patch list in local_patches contains anything that looks like a 
> > perl variable, it gets interpreted *as* a variable by 'perl -V' which 
> > builds a little perl program to actually display the output.  The 
> > attached patch protects the local_patches content with q{} instead of 
> > q"" - it's not a complete fix as a unbalanced { or } in a local_patches 
> > string will still break it, but it's better than what is there.
> 
> Good idea
> 
> > --- 1490,1496 ----
> >   		    sv_catpv(PL_Sv,"\"  Locally applied patches:\\n\",");
> >   		    for (i = 1; i <= LOCAL_PATCH_COUNT; i++) {
> >   			if (PL_localpatches[i])
> > ! 			    Perl_sv_catpvf(aTHX_ PL_Sv,"q{\t%s\n},", PL_localpatches[i]);
> >   		    }
> >   		}
> >   #endif
> 
> Can perl use literal ASCII NUL as a quoting character?

yes:
$ perl -we 'eval qq(print q\000foo\000)' | od -c
0000000   f   o   o

Thread Previous | Thread Next


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