This Week on perl5-porters (9-15 September 2002)

This Week on perl5-porters (9-15 September 2002)

This was not a very busy week, with people packing for YAPC::Europe, and all that... Nevertheless, the smoke tests were running, the bug reports were flying, and an appropriate amount of patches were sent. Read about printf formats, serialized tied thingies, built-in leak testing, syntax oddities, et alii.

printf format documentation

Allen Smith pointed out (in bug report #17075) that the documentation for printf in perlfunc is innaccurate regarding the %g and %G format specifiers. In fact, the thread goes through commentary of the C standard, and its implementation (or should I say interpretation) on various platforms (e.g. the availability of the long long type).

Data::Dumper and tied objects

Slaven Rezic asked whether Data::Dumper should support tied objects. Brian Ingerson answered that no, his opinion is that the tiedness should lay outside of serialization.

Slaven also provided a new test file for Data::Dumper, containing some TODO tests for a bug he just found. Apparently this is a rather obscure bug, which seems only be triggered if Freeze/Thaw is used in the pure perl version of Dump (Dumpxs works fine) and the object type changes.

-DLEAKTEST doesn't work

It has been reported (bug #17197) that perl 5.8.0 cannot be built with threads and with the CPP symbol LEAKTEST (once referred to in perlrun.) Andy Dougherty mentioned that LEAKTEST didn't really work in any case, and has not really been supported since before version 5.000. Nick Ing-Simmons and H.Merijn Brand voted for its removal.

Testing for magic

The discussion on v-strings from the previous week continued. The new v-strings, if you don't remember, are scalars with 'V'-magic attached to them. So, to test whether a given scalar is a v-string, we should test whether it has 'V' magic. It's possible with XS or by using the B module, but that's not actually very straightforward, so John Peacock proposed a patch to add a function isvstring() to Scalar::Util.

Syntax incompatibility with the // operator

Rafael Garcia-Suarez found that

    sub f ($) { } f $x / 2;

wasn't anymore accepted by bleadperl. This was due to a parsing incompatibility introduced by the new // operator. This was corrected, but the following construct is still a syntax error with bleadperl :

    print $fh //;

In brief

After some gcc-ism being tracked down, ANSI C compilers are now able to compile Nicholas Clark's copy-on-write code.

H.Merijn Brand has now write access to the Perforce repository where the source for bleadperl is kept.

Josh b Jore noticed (bug #17088) that once a scalar variable is local()ised, its pos() is lost.

Perl 5.8.0 can't be built on NetBSD/alpha with an older gcc, due to a bug in gcc's optimizer. The fix is to pick up a newest compiler, or to compile without optimization. Jarkko Hietaniemi provided a patch to the hintsfile for NetBSD to check this. (Bug #17174.)

chromatic proposed a patch that reimplements AutoLoader::import() to avoid a dependency on the Exporter module. Not applied, it was flawed. So he proposed a second (better) patch, that waits for its turn in the queue.

Alain Barbet provided a impressive stack of smoke tests (various combinations of Cygwin, Solaris, Linux, *BSD, on Sparc, PPC and x86!)

Following a bug report (#17208) by Vincent Lefevre to fix small typos in the perlmodlib man page, I found that it included an incomplete list of modules. Fixed.

Cwd::chdir('.') apparently hangs on Solaris. Bug #17227, reported by Akim Demaille, and on which nobody commented.

Brian Korver reported that the alarm() system call is broken with perl 5.8.0, at least on FreeBSD, when mixed with the gethostbyname() system call. See bug #17341. This is probably caused by the new safe signals in perl 5.8.0 (see the corresponding entry in perldelta).

About this summary

This summary brought to you by Rafael Garcia-Suarez. It's also available via a mailing list, which subscription address is Comments, additions and low-temperature flames welcome.