This Week on perl5-porters - 24-30 October 2005

This Week on perl5-porters - 24-30 October 2005

Mathoms, fixes, hobbits, speedups, all of them together advancing the development of Perl.

A maint Snapshot

Nicholas Clark rolled out a maint snapshot towards 5.8.8. He called for reports of success and failure while stuff integration from blead to maint goes on. In the followups, OS X Tiger and Mandriva Linux seemed to be quite happy with the current state of maint. Nicholas' plan hopes to see another snapshot about a week later and probably 5.8.8 RC1 one week after this.

    Nicholas' announcement
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00740.html
    The snapshot
    http://opensource.fotango.com/~nclark/perl-25817.tar.bz2

Cut-and-Paste Findings

Jarkko Hietaniemi posted the findings of cut-and-paste code on blead@25827. That triggered a discussion on how to deal with repeated code, why it is worthy and when it could be desirable.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00748.html

Getting sort() Right

Robin Houston had no rest this week fighting battles with recursive sorts and issues on fiddling with active subs.

Robin started wondering about the rationale behind the "Can't redefine active sort sub" thing and found a number of bugs in the way. These bugs were related to oversights in doing multiple calls to subroutines and affected sort() as well List::Util. To solve the issue, Robin thought of a set of macros *MULTICALL* for repeatedly calling the same sub and intented to make easier to get right code like the sort implementation.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00791.html

Robin showed yet another subtle bug when you call sort() with a sort sub that's already active.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00820.html

Ben Tilly, the requestor of RT ticket #36430, explained Robin what exactly made the ticket issue unlike the one of bug #7063.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00828.html

Then, Robin prepared drafts of his so-called sort/multicall patch. Yitzchak Scott-Thoennes prodded for tests and Graham Barr (the maintainer of List::Util) asked for description of what really changes and how compatibility may be preserved/restored.

    First draft
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00823.html
    Second draft
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00849.html
    Getting there
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00884.html

pp_push() Gets Faster

Tassilo von Parseval stumbled at a comment at pp.c and found a good opportunity to speed up pp_push() for the case of pushing multiple elements. Yitzchak Scott-Thoennes had comments and suggestions that led Tassilo to write a more effective patch, illustrated by benchmarks hinted by H.Merijn Brand. Rafael applied it as change #25854.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00752.html

Mathoms Held Together

Back in June, Nicholas Clark suggested the name mathoms.c, for a file holding C functions still kept around for binary compatibility reasons. (For the record, mathoms will be yet another Tolkien's reference in Perl source code.) This week, Steve Peters made it happen with a patch to create the new file and a configure switch to turn on/off the inclusion of the file in the build. Ronald J. Kimball and Philip M. Gollucci played the part of the ones who don't like the name. Rafael Garcia-Suarez thought Steve's patch would break build on everything but Unix. Steve asked for pointers on what files would need editing in other environments and, confronted with golden silence, found those files and made what was necessary, applying change #25866.

    Nicholas coins the file name
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-06/msg00077.html
    Steve Peters gets mathoms together
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00799.html

Ken and PerlIO

Panic with Multiple Encodings Ken Hirsch reported bug #37526 which shows how using multiple encodings at once may cause panic (more exactly, "panic: sv_setpvn called with negative strlen").

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00813.html

Reconciled 3-arg Opens Ken Hirsch reported yet another problem with PerlIO encoding layers. This time, in RT ticket #37533, he noticed that three-arg opens seem to always ignore default layer settings by the open pragma. Furthermore, he pointed an issue that Rafael Garcia-Suarez considered a contradiction between the open pragma documentation and perlfunc. Rafael produced a patch to reconcile the 3-arg opens with the open pragma settings and suggested to settle the perlfunc behavior as the correct one.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00822.html

Gory Quoted Constructs

Bas van Sisseren in bug #37527 reported the parser was having trouble with regexes delimited with [] and backslashes. Jeff 'japhy' Pinyan elucidated the gory details which Rafael Garcia-Suarez believed to be documented in perlop, although not very clearly. Bas proceeded to patch B::Deparse which he was using when he met the problem.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00814.html

Pre-loaded Perl executables

Joseph Thames exposed a maintenance issue at his actual work environment using Perl, Apache, mod_perl and various CPAN modules with very demanding requirements. He was looking for a scalable solution minimizing configuration, preferably with native executables and wondered if there was a standard way of using early-bound Perls rather than the dynamic traditional way. Yitzchak Scott-Thoennes advised about the highly experimental nature of B::C or B::CC approaches and about PAR as a candidate for the job. He also referred Joseph could reach a wider audience by asking at perlmonks.org. John Peacock suggested him to also evaluate perl2exe in his context.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00829.html

Fast IO::File Once Again

Pratik noticed that a recent change at IO::File introduced a call to File::Spec->rel2abs() which uses Cwd that in turn forks a new process to determine the working directory. This led to a major performance hit. Gisle Aas explained the change was due to fixing a failure in Windows and soon found a way to fix the situation with a 3-arg open instead of munging with file names. Steve Peters applied and that made Pratik happy and eager to see the fix in 5.8.x branch as well.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00856.html

Multi-threaded IO::Socket

Peter Millington had a multi-threaded application and found some trouble when using IO::Socket and Net::FTP in such environment. He asked whether the corresponding objects are believed to be thread-safe and explained how he worked around the issue with a change to IO::Socket::Net::configure(). Rafael Garcia-Suarez confirmed there may be problems with IO::Socket and threads, called for a patch in unified diff format and greeted opinions on other points raised by Peter.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00865.html

utime's Turn

In July, Gisle Aas set a trend on taking advantage of the corresponding C fxxx() functions to implement builtins like chmod, fchown, and fchdir. This time, Yitzchak Scott-Thoennes proposed to make utime use futimes where available. Gisle Aas backed it up and waits for somebody to add Configure probes for futimes.

    Gisle's start
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-07/msg00730.html
    Yitzchak's turn
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-07/msg00730.html

Extending Left Bit-shifts

Tassilo von Parseval wondered whether perl could try to use the biggest available native integer type for left bit-shift operations. Adriano Ferreira believed perl would better stick to its configure/build-time integer types and bigint pragma would be there for arbitrary precision integer arithmetic. Tassilo and Tels pointed the inconvenience of the performance hit when using Math::BigInt. Yitzchak Scott-Thoennes foresaw trouble in upgrading IV to NV types for integer-type operations like shifts.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00881.html

John and VMS

VMS failure summary After a failure summary of blead on VMS by John E. Malmberg, Rafael Garcia-Suarez thanked John (in the name of all perl5 porters and lovers, I dare to say) and gave a clue on making tests more portable.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00754.html

VMS exit handling After sorting out most of the issues in exit handling in VMS, John E. Malmberg asked for help to make it right once and for all. In fact, he did work out his own way and regretted not being able to change the default behavior due to the compatibility burden, which was commented by Rafael Garcia-Suarez. And then John posted what he expects to be the last VMS exit/error fixes that were needed.

    Call for help
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00746.html
    Hopefully the last fixes
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00817.html

vms.c improvements and fixes John E. Malmberg introduced in vms.c a new do_mp_rmsexpand() to support longer filenames for platforms/versions where it makes sense. While on this, he fixed memory leaks in old do_mp_rmsexpand() and made code safer with memmove() replacing memcpy().

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00837.html

sprintf on VMS John E. Malmberg posted a minor change to reflect the fact that sprintf in VMS returns the length of the buffer.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00802.html

Jarkko and Symbian

This week, Nicholas Clark and Jarkko Hietaniemi discussed what changes would be needed to make Encode work with the constraint of non-writeable data on Symbian. The issue at stage was how changes in underlying structure types would break compatibility among Encode and older format encode tables.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00700.html

Jarkko also announced better support for Series 80 devices and some handy utilities for Perl on Symbian.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00840.html

More Platform Specific Issues

Cygwin, unlink, Win32 Sébastien Aperghis-Tramoni noticed how weird Perl on Cygwin can be when issuing code like this:

    open FILE, '>', $file;
    unlink $file or warn $!;
    opendir DIR, '.';
    print "here yet" if grep { $_ eq $file } readdir(DIR)

unlink() succeeds but the file can be seen yet with readdir(), even though it is gone when the script ends or when the file is closed. To Sébastien, it does not feel like Unix or Windows. Yitzchak Scott-Thoennes quoted perlport: "Don't unlink or rename an open file" for portable code. Some discussion ensued with Yitzchak Scott-Thoennes unveiling the relevant Perl source code and Yves Orton explaining oddities in Win32 API. Very instructive and scary.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00846.html

AIX Woes David Favor had some trouble building blead on AIX. Rafael Garcia-Suarez pointed it was probably due to the Makefile failing to use makedef.pl to generate perl.exp where that matters. And then it worked.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00886.html

EBCDIC, Unicode, unpack Sadahiro Tomoyuki explained the results Rajarshi Das was seing using unpack with formats 'U' and 'C' on EBCDIC platforms: a UTF-8 versus UTF-EBCDIC issue.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00889.html

A Linux Issue Jason Vas Dias found perl.h to incorrectly guess the IOPARM_LEN on Linux to be constant 256 and posted a patch to use the _IOC_SIZE as it should. Rafael tweaked the change to avoid misterious side-effects on some other random platform and applied it.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00826.html

Perl5 Bug Summary

The open tickets count was at 1519 in Oct 24 13:00.

    Robert Spier and the Bug summary
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00257.html
    Perl RT just now
    http://rt.perl.org/rt3/NoAuth/perl5/Overview.html 

In Brief

Exit Code in 5.8.8? Nicholas Clark, after seeing a lot of patching in exit code, asked whether it just had to do with VMS or if it affects Unix and Windows sides. He wondered about the convenience of integrating this to maint now or in a couple of months. No answer so far.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00775.html

Revisited cc/cppsymbols Yitzchak Scott-Thoennes posted a patch to fix a long-standing bug on Configure's test for cppsymbols with values which contain spaces, such as Cygwin's _LONG_DOUBLE=long double.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00709.html

mv-if-diff Days are Counted Rafael Garcia-Suarez posted a patch to remove mv-if-diff from the main makefile and asked for people to try it. Nicholas did and found the need for a tweak.

    The "remove mv-if-diff" campaign summarized
    http://dev.perl.org/perl5/list-summaries/2005/20050926.html#The_Future_of_mv-if-diff
    This week
    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00788.html

White Smokes for Compress::Zlib Without much ado, Paul Marquess filed a fix for the Compress::Zlib's smoke failures seen on Win32, which was applied by H.Merijn Brand with great expectations.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00794.html

warnings.pm Works as It Should Rafael Garcia-Suarez dismissed bug #36781 which claimed functions enabled, warn, warnif in warnings.pm were buggy. He explained how the reported behavior was the intented one according to the docs and Paul Marquess noted it is all there in perllexwarn.pod.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00838.html

Named Escapes in Eval Peter Scott noticed an oddity when using named escapes in evals and thought a POD fix could be in order. Sadahiro Tomoyuki suggested the issue could be slightly different as well as the appropriate doc fix.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00870.html

Misleading Closures in Regexes William L. Devanney opened RT ticket #37543 after being surprised with how $^N worked with respect to global and lexical variables. Jeff 'japhy' Pinyan explained the point was the use of regex construction ?{} which creates a closure around the lexical environment and a known bug that makes it refer to the first time the regex is compiled, giving wrong results for subsequent calls.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00866.html

perl5db.pl Fix Brendan O'Dea sent a patch for fixing an incorrect instruction in termination message emitted by perl5db.pl.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00897.html

Free the Tries Jarkko Hietaniemi spotted and patched a bug in regcomp.c that prevented tries to be freed.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00905.html

ExtUtils::Constant and Perl 5.004 Sébastien Aperghis-Tramoni posted a small patch to restore ExtUtils::Constant compatibility with Perl 5.004.

    http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-10/msg00945.html

About this summary

This summary was written by Adriano Ferreira. I would like to acknowledge a mistake and apologize myself to H.Merijn Brand for spelling wrong his name in the last summaries. Please correct me and send comments.

Information concerning bugs referenced in this summary (as #nnnnn) may be viewed at http://rt.perl.org/rt3/Ticket/Display.html?id=nnnnn

Information concerning patches to maint or blead referenced in this summary (as #nnnnn) may be viewed at http://public.activestate.com/cgi-bin/perlbrowse?patch=nnnnn

Weekly summaries are published on http://use.perl.org/ and posted on a mailing list, (subscription: perl5-summary-subscribe@perl.org). The archive is at http://dev.perl.org/perl5/list-summaries/.

If you found this summary useful or enjoyable, please consider contributing to the Perl Foundation to help support the development of Perl.