=head1 This Week on perl5-porters - 28 April-3 May 2008 I. -- Jesse Vincent, not a bad lad to spend a tad on MAD. (gad, Dad! it's not a fad). =head1 Topics of Interest =head2 More on tainting Nicholas Clark thought that a of points Paul Fenwick made regarding late-acting taint weren't borne out by an inspection of what the source code actually did. Although, looking closely, he found a couple of suspect constructs. He thought that one possibility was to alter C<$^TAINT> to be C if no tainting, 1 (or true) if -T tainting, or 0 for late-acting tainting. Then again, Paul's idea of deprecating late-acting tainting sounded like the path of least resistance. better to be safe than sorry http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00720.html =head2 Support mallocs of struct T, which contains struct S[N] Nicholas apologised to Jim Cromie for having not applied his patch, noting that at the moment Rafael seems to be the only person with enough motivation to apply patches. He thought that Jim's avenue of research seemed promising and suggested he keep slogging on to see whether the rest of it works. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00722.html =head2 Bug in C In a parallel thread (to bug #53504), Matt Sergeant reopened the discussion about filehandles persisting past their due date. The problem arises when one opens a file as a side effect of a conditional in an if statement. When Matt learnt that it was sufficient to wrap the C block in a curly block to force the handle to be closed early, he deemed that it was no longer such a problem. Hint: if bug reports don't contain the word "perl", they run the risk of being filed in a "possible spam" folder for human perusal. it's all right http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00660.html http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00009.html =head2 5.6.x in the wild A recent change to the GNU C package has broken the F script for 5.6.x (or rather, it's been fixed for more recent perls for ages, but hasn't been, and is unlikely to be backported to 5.6.x). Jesse Vincent asked for a show of hands to see how many porters are still using 5.6, to gauge the importance of creating a fix for software that was released eight years ago. Gabor Szabo won a surprisingly crowded race, by having the courage to admit that he has a client still running perl 4.x in a couple of places. an unscientific survey http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00682.html GNU coreutils 6.9 breaks F (#53446) http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00681.html =head2 Prototypes, parsing and optrees Nicholas Clark thought there was a smidgen of performance to be gained by figuring out what context a routine needed to used to call a function and that maybe a prototype, or its absence, could help. But Rafael explained that what he was looking at was actually from something completely different, so the question is moot. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00750.html =head2 Weird kernel failure in F in blead@33758 David Landgren related the tale of a test suite falling into an infinite loop, spewing out the message Fatal error 'Exceeded maximum lock level' at line 199 in file /usr/src/lib/libpthread/thread/thr_rtld.c (errno = 136039556) and wondered if it was the symptom of some recent change. Nicholas Clark thought that the fact that the test was run on a 6-cpu machine running FreeBSD 6.0 was probably a better explanation. Nicholas also thought it would be slightly more helpful if the C<-V> switch were able to report the number of CPUs on the machine, at least for a subset of platforms where such a test was easy enough to determine. Abe Timmerman looked at the code in Test::Smoke::SysInfo and wrote no, but I think he meant yes. If so, it should just be a simple matter of programming... http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00751.html http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00042.html =head2 Smoker segfaults on OpenBSD 4.1 Stephen Schubiger reported that smoke tests of blead had been crashing with what turned out to be low-level XS problems. Abe Timmerman had heard of the problem also occurring on FreeBSD 7.0. In the meantime, Stephen discovered that the latest release of the smoker's companion (Test::Smoke 1.32) fixed the problem. smokers of the world, upgrade http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00782.html http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00053.html =head2 5.8.9-to-be on Irix David Cantrell reported the results of a smoke for the upcoming 5.8 release on IRIX. Everything was fine except for a couple of failures in C. One issue involved taint, the other was possibly related to CPAN# 30710, but Sébastien Aperghis-Tramoni had no real idea about the heart of the problem. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00810.html http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00024.html Similarly, the same problem also occurred with blead, although C and C were also giving grief. bleeding on Irix http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00002.html =head2 Parameterize C Jim Cromie delivered another fiendishly obscure patch to improve the performance of ptr_tables, which serve an important role in implementing hashes. Part of the aim was to expose the guts so that things like Storable could delve deeper into the core for an increase in performance. Nicholas Clark was a bit uncomfortable with the idea, expressing the wish to see more performance tweaks that don't expand the public API. Apart from that, he felt that Jim's research might be help re-tune various magic numbers used for sizing things in the core. The main sticking point was a useful set of benchmarks to help examine the result of changes to the core. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00007.html =head2 Another perldoc shortcut It suddenly dawned on Gisle Aas that instead of typing C one could just as easily type C. He wrote a patch so that if it failed to find something, it would prepend "perl" to the search string and try again. Thus C would continue to return the page on the C pragma, rather than the C page. all that's lacking is shell auto-completion http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00025.html Adriano Ferreira liked the idea so much he pushed C version 3.14_06 out to CPAN and asked for feedback. RFC http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00045.html =head2 Upgrading to C 5.47 The CPAN version has apparently been moving files around in the distribution, and this is naughty, since it causes more work when integrating into blead. Still not sure if it's all tidied up yet. bumping into things in the night http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00034.html =head2 Bug or not? constants warn only once Nicholas Clark excoriated the list for wasting time on pointless questions (why is Ruby slow?) rather than answering more mundane questions which would help things move forward. The issue at hand was whether constants should warn once, or as many times as necessary. Both outcomes are doable, and feasible, so we just need to decide what to do. All he wanted was someone's opinion. Aristotle Pagaltzis wanted to be sure that whatever was changed wouldn't make things slower than they are now, expressing the opinion (yes!) that things had become slower over time (although for the most part the price was happily paid). He also took the time to rewrite Nicholas's proposed tests into something he felt was easier to read. Dave Mitchell was very surprised to learn of 2x slowdowns in the regexp engine, and thought that if this was true then it was something that needed fixing. Aristotle referred him to an article by Ben Tilly. Ilya's insight http://perlmonks.org/?node_id=502408 http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00048.html =head2 MAD Dumper - missing encoding of XML-unsafe literals in "pre" Jesse Vincent looked at the state of MAD mode in Perl and was dismayed by the paucity of tests as well as the way it generated XML. Part of the problem was the fact that the test suite relies on C, which is a slightly odd state of affairs to have. At least until Dave Mitchell gets around to writing an XML parser using F. Unfortunately Jesse used 5.10.0 as a basis, and significant changes have been made in 5.11 and thus the patch could not be applied. Plus Gerard Goossen had already fixed it. Nevertheless, had it been applicable, it would have leaked a scalar, although fortunately Rick Delaney was around to show Jesse how that could have been fixed. teacher tell me what's my lesson http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00054.html =head1 TODO of the week =head2 The yada yada yada operators Perl 6's Synopsis 3 says: I Those would be nice to add to Perl 5. That could be done without new ops. =head1 Patches of Interest =head2 F Alexandr Ciornii offered a patch to allow C's C function to be tested correctly both in the CPAN module and in the perl core. and strong coffee http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00653.html =head2 Testing C<$/> with in memory files Bram noticed that bug #44833 had been resolved, but no tests were ever added to help pin down the issue. There was an issue with the test being run by C, which would possibly give it fits, so Bram tweaked it to be skipped if run by C. Rafael applied the patch as it stood, but Ben Morrow thought of a tweak for additional robustness. Bram adopted the idea, but it was apparently left unapplied. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00657.html =head2 Extra tests for F As a follow-up to the READONLY bug from last week, Bram added a couple of tests to make sure things stayed sane. After have mulled over the issue for a while, he returned to it again this week, asking the porters whether a deeper overhaul was needed concerning these tests. Warnocked http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00776.html =head2 Win32 process ids can have more than 16 bits Jan Dubois tweaked the Win32 code to return the full 32-bit PID value on Windows platforms. He also mentioned that C behaves slightly differently on Windows, in that it returns the PID and not the exit status. Paul Johnson thought it was high time (since he's been waiting on it for ten years) to either document the issue properly, or come up with a better interface. 32 bits ought to be enough for anybody http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00728.html =head2 Two less double magic warnings Vincent Pit wrote a patch to kill a redundant warning in the construct C http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00764.html as well as C when $m is undefined. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00786.html Rafael liked these patches so much, he applied them. =head2 Detab and move POD in F In a prelude to major cleanups in C, David Landgren submitted a patch to cleanse the whitespace of tabs, and a second patch to push the POD down to the end of the file (hint: this comes in handy when using C). H.Merijn Brand was loathe to apply the patches, since he remembered Tom Christiansen vehemently opposing the change last time someone tried to reformat the code for "stylistic" purposes. to be continued http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00806.html http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00011.html David also noticed that the tests for C relies on being able to find F or F and wondered if C from Test::More wouldn't do just as well. evil external OS-dependent dependencies http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00759.html =head2 C<~~> with non-overloaded objects With a very small dash of C, Vincent Pit tweaked smart matching to croak on a non-overloaded object. This made Ricardo Signes, who raised the issue in the first place, very happy. r e s p e c t (staying out of the living room) http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00014.html =head2 Add some links to external resources Shlomi Fish suggested some links to web pages in the documentation, but qualified his patch with a complex web of licensing details. This prevented the patch from receiving much serious consideration. licensed to patch http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00039.html =head1 New and old bugs from RT =head2 C generates incorrect HTML for C<=item *> (#19655) David Landgren went through the open bugs for C and noticed that this one has been fixed as recently as in 5.10.0. resolved http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00043.html =head2 Bug in C on Windows when target dir is bare drive letter and C (#41555) Bram wrote a patch to correct the problem, but wondered how one would go about how one could write a test for the behaviour. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00804.html =head2 Infinite recursion related to C, overloading, C and C<\x{...}> (#41618) Bram noted that this problem is still around on blead, and was able to refine the test cases to show what does and what doesn't cause a segfault. getting better all the time http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00799.html =head2 Unicode and case insensitive regex (#41664) Bram discovered that for some reason the problem goes away if anchors are used in the pattern match. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00800.html =head2 C replace user error message by own (#42329) Bram wrote a patch to make C croak with a more useful error when there are no file descriptors available to pull in C. now you know why http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00794.html =head2 C ignores C<^M> in scalars? (#43617) Bram tried to convince the bug reporter that this was more a problem of shell interpretation of newlines rather than being the fault of C. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00672.html =head2 Missing tests for C with Nan/+Inf/-Inf (#45383) Bram wrote some patches to pin down the behaviour of C. Applied by Rafael Garcia-Suarez. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00665.html =head2 Clarification about C<@ISA> declaration in F (#45733) Bram saw that the patch attached to this bug report had never been applied, and asked why. Rafael explained that he never saw it on the mailing list the first time around. will it be applied this time around? http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00664.html =head2 Split function broken on MacOS (#46073) Bram found another patch that had been overlooked and so Rafael applied it. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00650.html =head2 C reports incorrect line number for errors or warnings (#46369) Anon Sricharoenchai thanked Bram for his followup on how to resynchronise perl's concept of line numbers when dealing with files that contain Perl and non-Perl chunks. or try Inline http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00733.html =head2 Clearing magic (or C0> for empty C<$@> if utf8 is in use) (#51370) Animator had opened this can of worms last week on the clearing of magic on C<$@> with an exploration of sorts on how to fix it. Rafael Garcia-Suarez commented saying that the results looked reasonable, but of course one could only be sure with a series of new tests to ensure that nothing had been broken. So Bram wrote some code and tests and asked for comments. Nicholas Clark thought that the code Bram had written had the freeing and clearing of magic the wrong way around. The code also introduced a new class of macros to deal with the situation; Nicholas felt this added unnecessary complexity. Another thing that caught his eye was the fact that one of Bram's tests induced a C. This will need to be looked into. Bram thought that this was probably a side effect of the UTF-8 flag not being cleared when it should have been. So Nicholas did that, and a after thinking about it for a bit thought that C might be to blame. He and Bram kicked the idea around a bit more and at one point a proposed change might have had the side effect of allowing C<$@> to become tie-able. Nicholas thought that this was a bit sick, but then again, hmmm. There has been talk of promoting C<$@> to a first-class object... http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00656.html http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00056.html =head2 perl-5.10.0-33733 assertion with JSON::XS-2.2 (#53244) This is the thread with Marc Lehmann discussing the use of C. The only followup this week was from Sam Vilain, wondering if there was a problem or not with C and whether Marc might not be too liberal in choosing when to access C. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00724.html =head2 Parse problem in C (#53414) Don't use it. Even the author says so. when given a real switch http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00713.html =head2 A bug with C that might be a guts bug (#53482) A change in the core might have been the cause of the problem. Bram added some tests to make sure things didn't drift in the future. After a couple of idle suggestions, Andreas König came through with the patch that seemed to be the root cause. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00730.html http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00010.html =head2 F should use the DirectoryService on OS X (#53500) Jan Dubois outlined the approach that he thought should be taken to fix this bug, admitting that he didn't have the time right now to pursue the issue. feel free to jump in http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00757.html =head2 Some UTF-8 string with CP932 encoding will freeze DOS BOX (#53502) Chihiro reported that writing a program in a Japanese environment worked, but if the program had a different name, it would freeze inside a Windows DOS box. No comments. might be a ^S http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00738.html =head2 Bug in C scoping (#53504) Matt Sergeant was surprised to discover that C<$fh> was not destroyed until the end of the scope encompassing the C, rather than at the end of the C block. In the subsequent exchange, a work-around was suggested, and the usefulness and hatefulness of lexicals "leaking" across if/elsif/elsif blocks was debated. been there since 5.003 http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00737.html continued in May http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00013.html =head2 Overload and fallback binary or (|) (#53550) Bram opened a ticket related to bug #53482 which showed the overload fallback mechanism privileging string context rather than numeric context, which, in the context of the bug, would have been more useful. Rafael explained that binary or (C<|>) works on both string and numbers, so it would be hard to discern what was needed in a systematically correct way. David Nicol speculated on the possibility of allowing the author of the overloading to give numeric context the first chance and resolving the overload. "we travel on the quiet road" http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00778.html =head2 Range operator and magic (#53554) Bram opened another ticket regarding the range operator, wondering why the interpreter inspects the contents of C<$x> six times in the fragment C<@y = $x .. $x>, where $x was a tied variable (and thus if the magic was being used to piggy-back side effects, the double magic would throw things out of kilter). The prompted Dave Nicol to ask if the range C<1..$x> was driving a for loop, what would happen if the C<$x> value was modified in the loop. Bram thought that it shouldn't be allowed, and promised a TODO test for it. magic and loss http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00795.html http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00022.html =head2 Patch for linux LDAP groups (#53560) David Dick encountered a test failure regarding groups (as in F) containing spaces in names. This occurred on a Linux box using LDAP authentication, and so his expedient fix was to add Linux to the list of platforms where group names could be expected to contain spaces. Rafael applied the patch, but H.Merijn Brand rightfully pointed out this scenario would play out the same way on many other Unix-like platforms. In which case, a much more robust solution would be to determine if LDAP (or in fact any NIS/NSS mechanism, come to think of it) was in use, and use that as a basis for the test. wanted: finer discriminant http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00798.html =head2 Zero-length regex bug (#53562) Another victim failed to notice that C has special meaning. That the problem comes up so frequently caused David Nicol to conclude that the documentation needs a special EMPTY PATTERN section. only a wafer-thin documentation patch needed http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00797.html http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00004.html =head2 perl5.10 and blead crash on win32 (#53586) Dmitry Karasik uncovered a snippet that runs fine on FreeBSD but crashes on Win32. Then again, it does involve C, SIGPIPE signals and setting far too many things to C. bad magic http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00005.html =head2 Perl5 Bug Summary All hail Bram, the new Perl5 bug warrior. 288 new + 1472 open = 1760 Created this week: 8 Closed this week: 64 may his wrangling be long and fruitful http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00694.html http://rt.perl.org/rt3/NoAuth/perl5/Overview.html =head1 In Brief Bram's B> made it in http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00649.html as did Vincent Pit's patch for B (bug #51636). http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00030.html On the B thread, Alberto Simões forwarded a message from Leopold Tötsch that gave some Parrot benchmarks on crunching Mandelbrot sets. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00655.html John E. Malmberg took a second shot at B. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-04/msg00663.html Marc Lehmann read a B which is interesting because it reduces the number of comparisons that need to be performed, which is useful in a language where the compares themselves are expensive. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00037.html B was still B due to F, F, F and F. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00052.html Jesse Vincent found a teeny tiny typo in B 2.24's F>. Applied. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00051.html =head2 Last fortnight's summary This Fortnight on perl5-porters - 13-27 April 2008 http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-05/msg00050.html =head2 About this summary This summary was written by David Landgren. Weekly summaries are published on F and posted on a mailing list, (subscription: F). The archive is at F. Corrections and comments are welcome. If you found this summary useful, please consider contributing to the Perl Foundation or attending a YAPC to help support the development of Perl.