This Week on perl5-porters - 17-23 February 2008

This Week on perl5-porters - 17-23 February 2008

Nicholas: So, it seems that constant folding runs in "compile time", which scares me somewhat. Surely it should be running in run time?

Rafael: The whole point of compile time optimisation is that it runs at compile time, isn't it?

Nicholas: Runs *at* compile time, but (I assume should) run under run time rules. There appear to be special exceptions scattered throughout the code that certain things aren't fatal if compilation is in progress.

(debating the elegant simplicity of the Perl 5 internals).

Topics of Interest

pp_const cools off

Nicholas Clark applied Vincent Pit's patch from last week to slim down pp_const by splitting the op into two, which eliminates a costly branch.

Sébastien Aperghis-Tramoni reported that his web service that showed the gcov output of the Perl codebase had gone belly up (it was by poring over a gcov run that Nicholas spotted the original opportunity to optimise).

Abe Timmerman said that a similar offering of his own was still up, except that the perl.gcov target was currently broken, so there was nothing to show.

  paths not taken

To B or not to B

Jim Cromie and Reini Urban discussed the finer points of testing the B modules.

Reini posted some B::Debug enhancements.

Reini finished up with the delivery the delightfully named B::MAD module. He wasn't sure of the usefulness, but reasoned that some mad hacker might be able to put it to use.

  don't worry B::Happy

extending t/ to set the subprocess ENV

Jim Cromie found a simpler way to set up the environment of a test requiring a fresh perl to be launched. This was to allow PERL_XMLDUMP to be specified, in order to verify MAD output.

Nicholas wondered if Jim's hack was VMS-compatible. Craig A. Berry suggested that all that was needed was the correct use of local. Hilarity ensued as Yitzchak Scott-Thoennes shot down each of Jim's attempts to effect the change in a loop, which had the result of the localness (locality?) evaporating at the end of the block.

  need a hash slice to go

Somewhere along the way, Jim noticed a couple of warnings about unused variables when MAD is enabled.

You can't always optimise what you want

Nicholas Clark continued with his interesting self-contained task from last week that dealt with constant optimisations and thought it should be possible to unroll constant packs. (like $var = pack("a2", "xyz") being replaced by $var = "xy"). He had the source code that could more or less do it, but ran all around the codebase trying to find a place to lodge it so that it would be acted upon at the right time. He finally wound up where he started from, and realised that it wasn't possible.

  nor do you always get what you need

Assistance with IPC modules and perl 5.10

Nicholas Clark and Andy Armstrong came through with the goods to figure out what was going wrong with IPC::Shareable and IPC::ShareLite on the upcoming Fedora release. So Fedorans will soon be able use 5.10 straight out of the box.

Modulo operator and floating point numbers

Ken Williams considered the recent change to the documentation concerning the modulo operator and suggested some further tweaks that Rafael applied.

He then started thinking about moduli of floating point numbers and was surprised by the results of the current implementation. Zefram pointed out that the same issue is described in his bug #41215.

Ken would have liked to make things behave in a more logical manner, but Rafael was happy to let sleeping dogs lie.

Perl on Symbian OS

Gowtham wanted to know if the perl port that ran on Symbian 8 was usable on Symbian 9. Jarkko Hietaniemi, author of the the original port, was sceptical, given that the platform had been locked down. This might mean that Perl (as an "unauthorised application") would not have the privilege of opening a TCP connection.

If the build toolchain has changed significantly then major work will be required to bring the port up to speed. In any event, Jarkko said that he had no more time to take care of it.

  sounds like no

PERL_RUNTIME, or, adventures in sprintf ops

Having discovered the nifty f flag and its positive impact on length, Nicholas reasoned that sprintf was a likely candidate for more of the same. Except things went wrong, and had him diving all the way back to Malcolm Beattie's change #44 from 1997. He managed to sort things out and wrapped it up in change #33369.

use encoding 'utf8' bug for Latin-1 range

Jarkko Hietaniemi kicked off a long thread last week, and was still bubbling along nicely as I summarised it. So the executive summary (subject to change, next week) is that use encoding is broken and its use should be discouraged.

UTF-8 problem with Perl 5.10.0

More UTF fun this week. Phil Harvey wrote to explain how he had been burnt by the changes to U0 and C0 flags for unpack, that used to allow one to sneak past the abstraction model and poke at the implementation details. This caused a number of mutually irreconcilable problems, and so the decision was made during 5.9 to make a clean break with the past.

  it /was/ noted as an Incompatible Change


Tels discovered ohloh, and its spectacularly out-of-date idea of activity on the Perl codebase. It was slurping the contents of Sam Vilain's git repository, and choking on the complex history of the codebase. This meant that it looked as if development stopped years ago. Andy Armstrong fixed up the summary info to indicate that Perl 5 is still alive and kicking.

Patches of Interest

Installing threads files on non-threaded Perls

Michael G. Schwern questioned the desire to exclude threads modules from being installed on non-threaded builds. His contention being that if someone uses the module on a non-threaded build, they get a nice, informative error message as to why things don't work.

If they are removed, then only a basic "module not found in any of these zillion directories" message is issued instead. Michael was worried that some people might go to all the effort of trying to download the threads package from CPAN, only to find out that it still doesn't work, and in fact cannot unless perl itself is rebuilt.

Jerry D. Hedden saw the logic in this line of reasoning, and reversed his stance.

  helpful errors

  back they go

Elsewhere on planet threads, Jerry pushed some more updates out.

  threads 1.69

  threads::shared 1.17

  Thread::Semaphore 2.07

  Thread::Queue 2.06

perl -M:Foo -we 1

Robin Barker related a discussion (and curiously, the discussion was about Perl) relating to perl -M:DProf -we 1 not generating a warning. So he tweaked the getopty code in perl.c to make it do so. Jim Cromie thought that the proposed warning, so worded, was not particularly helpful.

  -M doesn't get the colon

Convert Changes file to UTF-8

Brendan O'Dea converted Changes to UTF-8. I don't know what happened in transit, but the result was a mess by the time the message hit my inbox.

no archlib in otherlibdirs

Reini Urban proposed a change to the various lib paths. Rafael admitted the current mechanism was a bit ad-hoc and it reminded him that he needed to work on a 5.12 roadmap.

Andy Dougherty explained how things are supposed to behave currently. bug within overloaded stringification

Nicholas Clark tried to apply Marcel Grünauer's fix to NEXT but patch failed miserably in the attempt. Nicholas blamed Apple's software.

New and old bugs from RT

threads still crashing (#45053)

Jerry D. Hedden discovered that his thread segfaults would occur regularly on a machine with 4Gb of RAM, but not on another that had only 1Gb. He wondered if it could be the symptom of some bad signed/unsigned voodoo.

Tels replied that he was unable to provoke any crashes on his own machine.

QNX Test failures (#49818)

Matt Kraai diagnosed a series of test failures he was having on QNX. Two could be traced to tests building a .pbc file and then trying to overwrite it after it had been loaded. His brutal fix for that problem was to delete the file before overwriting it, but suspected there was a better approach to the problem.

The second series of tests were due to bugs in QNX's atof. So the fix here would be to tweak Configure to use Perl's own implementation.

bug in regcomp code leading to panic (#50114)

Yves Orton stopped and suggested a couple of source code changes to try and regretted that he didn't have more time to devote to the issue. He nevertheless found the time to commit change #33324 that he hoped would resolve the problem.

Apparently, it did.

In other news, Michael Schroeder (reporter of the bug) asked why $r=qr{^bar}; "foo\nbar" =~ /$r/m or die dies on blead, but not on 5.8. He tracked down where in the regexp engine things had changed (no mean feat) and wondered what the reasoning was.

Rick Delaney explained that he had made the change to fix a related matching problem, and had not thought to add a regression test that would have caught the change that Michael tripped over.

Yves felt that it could be fixed for 5.10.1.

modified hints for Darwin x86 64bit (#50946)

Daniel Quinlan supplied a patch to the Darwin hints file to allow a 64-bit perl build. Rafael applied the patch but Nicholas warned that there may be problems, since the 64-bitness of the build would not be reflected in machine/architecture pathnames. This could lead to all sort of mixed-bitness nightmares if different builds coexisted on the machine. Unless of course Darwin just does the right thing.

pod2man needs to translate some ASCII characters (#50950)

Mike Ward complained that backticks and dashes were being incorrectly translated by Pod::Man.

Install Perl-5.8.7 source on Solaris 10 Sparc (#50960)

Elad Dotan reported having trouble building Perl on Solaris, but provided so little information that diagnosis was difficult. Andy Dougherty tried, though.

Method dispatch breaks with defined(\&sub) (#51072)

Dagfinn Ilmari Mannsåker discovered that trying to call ->next::can on a package that has not (yet) been defined will cause a segfault. Rafael wrote a nifty patch to autovivify it as an empty package.

Perl5 Bug Summary

  288 new + 1499 open = 1787 (6 more, 4 less)

This is the BBC


Andreas König was surprised to discover that Devel::LeakTrace was broken, and in fact had been so since change #17968 from 2002. He wasn't sure on which side the fault lay.

In Brief

Robin Barker discovered some C files in the test suite that needed some consting goodness applied.

The recent change #33291 had VMS falling off the wall, so John E. Malmberg and Craig A. Berry put it back together again.

  the king's men

Reini Urban gave the Cygwin hints a little TLC. Applied.

Steve Hay revived the discussion about automated generation on Win32 configuration information, saying that he had improved the situation with some Makefile trickery, but full automation remained elusive.

  bespoke configuration

Porting/ really does indenting now. (Change #33352).

Jim Cromie tweaked his recent opcode generator tweaks, shaving a few more bytes from op.c.

About this summary

This summary was written by David Landgren.

Last week's is here

  This Week on perl5-porters - 10-16 February 2008

Weekly summaries are published on and posted on a mailing list, (subscription: The archive is at Corrections and comments are welcome.

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