
demerphq at gmail
Nov 3, 2009, 3:04 AM
Post #2 of 7
(661 views)
Permalink
|
2009/11/2 Nicholas Clark <nick [at] ccl4>: > On Mon, Oct 26, 2009 at 11:35:06PM +0100, Yves Orton wrote: >> In perl.git, the branch blead has been updated >> >> <http://perl5.git.perl.org/perl.git/commitdiff/9134ea20ecf6c7a898519ea43ac463bc4da08840?hp=2699d6345b651c48a820507d6287ddca1f5b2ee4> >> >> - Log ----------------------------------------------------------------- >> commit 9134ea20ecf6c7a898519ea43ac463bc4da08840 >> Author: Yves Orton <demerphq [at] gmail> >> Date: Mon Oct 26 21:52:05 2009 +0100 >> >> add an elipses to string/ref warnings when str longer than 32 chars >> >> Wasted a few minutes more than necessary trying to work out why the >> string was truncated when in fact it was the error message that was >> truncating the string. > > This seems a very sensible thing to do from the point of view of the core. > > >> EXTCONST char PL_no_symref[] >> - INIT("Can't use string (\"%.32s\") as %s ref while \"strict refs\" in use"); >> + INIT("Can't use string (\"%.32s\"%s) as %s ref while \"strict refs\" in use"); > > However, I find two references to PL_no_symref on CPAN - Data::Alias and > Sub::Name. With the change to a printf-style format string they now ouptut > garbage (or if unlucky, SEGV). Fortunately Data::Alias fails its tests because > of this. Sub::Name doesn't though. Both of these modules are in the "known problematic" category tho. > Given that there's exactly one reference to PL_no_symref in the core (now), > I think for it, it would be best to inline the literal string, deprecate it > from perl.h, and encourage the CPAN code also to inline the literal string. > (either the old version that they expect, or changed to add the elipses) > > But I suspect (or fear) that in general, strings defined in perl.h are part > of the "API" we export. If Matthijs fixes his code then there is no problem. Maybe I look at this differently than you. But I have done evil things with the internals of perl before in XS. I would hate to think that you or anyone else would consider breaking that code a reason not to improve Perl. I find it interesting actually as both of these modules satisfy my personal criteria for adding to perl. They solve problems that are incredibly difficult to solve *without* diddling with perls innerds, and they solve problems that a lot of people have said they would appreciate solutions to. There is an expression in precedent-based legal systems "Hard cases make bad law", and I think this is a hard case. cheers, Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"
|