Nicholas Clark <nick@unfortu.net> writes: >Sorry about the delay in replying to the original question. >On Wed, Dec 11, 2002 at 11:28:48AM -0500, John Peacock wrote: >> Rafael Garcia-Suarez wrote: >> >%_ : placeholder for an SV that will get stringified. See sv_vcatpvfn() in >> >sv.c. >> >I can't find doc on this in the perl sources, but there a small paragraph >> >about it in the Cozens & Jenness. > >I can't find any docs either. In fact, a straight grep on %_ in the >current sources is most unrewarding. > >> Neat! Is it supported in 5.005??? IIRC Chip put it in way back. > >Well, I had a grep in the 5.004_04 sources and it's in there quite a lot, >such as: > > if (in_eval & 2) > warn("%_", msg); > else if (in_eval) > sv_catsv(GvSV(errgv), msg); > >so I wondered what had happened to them all. The same piece of code is now: > > if (PL_in_eval & EVAL_WARNONLY) > Perl_warn(aTHX_ "%"SVf, msg); > else > qerror(msg); > >with this in perl.h > >#ifndef SVf ># ifdef CHECK_FORMAT ># define SVf "p" ># else ># define SVf "_" ># endif >#endif > >That doesn't seem to be in Devel::PPort (yet - patches welcome I guess) > >I wonder how many parts of the perl core can be reduced slightly in size >by changing %s SvPV_nolen(sv) to %_ sv. >This would have the beneficial side effect of making the non-error code path >more direct, which might have a slight speed gain. Again IIRC I thought that %_ was not quite the same as %s-of-PV. That is I seem to recall one motivation for put it in was to avoid stringifying things that were SvNOK and do %g on those and %ld on SvIOK - thuse there might be spots where changing to %_ would change what you got. > >It's not in 5.003_07's sources, but I don't think anyone really supports that >any more. > >Nicholas Clark -- Nick Ing-Simmons http://www.ni-s.u-net.com/Thread Previous | Thread Next