This Week on perl5-porters (1-7 March 2004)

This Week on perl5-porters (1-7 March 2004)

This week was one of those weeks where the bug reports outnumbered the bug fixes. Hopefully in the future the perl 5 porters will be able to keep perl 5 on the right track, as they continue to do, week after week.


Leon Brocard released perl 5.005_04, the latest perl in the 5.005 series. The official announcement is at :

Setting $!

Following a thread about an update to the perlxstut manpage that Marcus Holland-Moritz is writing, there was some interesting discussion about the proper way to set the $! errno variable from user code, whether this is a good idea, and how the PerlIO system handles it. Nick Ing-Simmons points out that $! is actually the C variable errno, and that perl stringifies it via strerror(3) when used in string context; and thus that it shouldn't be set to custom values and error messages.

About the debugger

Richard Foley added a couple of commands to the perl debugger: save, to save the current history to a file, and i, which prints the inheritance tree of its argument (if Class::ISA is installed.)

Chip Salzenberg finds out that the perldebugger sometimes hangs when it's back from a pager. Richard believes it's a known bug, but Chip is using the most recent 5.8.3 from Debian.

More on the famous lexical-in-conditional deprecation warning

Finally, Rafael changed his mind and preferred that

    my $x if $foo;

doesn't warn anymore, and that only

    my $x if 0;

does (clearly an abuse of the current accidental feature). The new form of this warning, implemented by Dave Mitchell, is now Deprecated use of my() in false conditional.

Range operator edge cases

Marcus Thiesen began to notice that undef .. undef produces a segfault with perl 5.8.x. Marcus Holland-Moritz provided a patch, but later tried some combinations with undef or an empty string at one or both ends of a .., and posted his conclusions (along with other bugs found and fixed) with some questions (what should undef .. undef and other strange combinations return?)

readline() and PerlIO slurp mode

Stas Bekman remarks that, in some cases, localising $/ isn't taken into account, because he observed that when doing

    print <$fh>;

print() is called as many times as there are lines in the file opened via $fh. Contrary to the first thoughts, this is unrelated to scalar context versus list context, but to some internal flags in PerlIO. Stas then admits to be unable to reproduce the mysterious problem after a perl upgrade.

Some Bugs

Yves Orton produces an error Attempt to free unreferenced scalar by blessing an anonymous glob (bug #27268), and by assigning the glob reference to the glob itself:

    perl -MSymbol -e 'my $x=bless \gensym,q/t/; *$$x=$x'

Bug #27344 shows a pos() bug which happens only when taint mode is on.

Lukas Mai remarks that the (;$) prototype doesn't mimic closely the way length() is parsed, making it impossible to override fully. (Bug #27380.)

Ton Hospel finds that returning the special arrays @+ or @- from a subroutine don't appear to work correctly. (no bug number for this one.)$34b$1%40post.home.lunix

In Brief

Dave Mitchell explains that closures are broken "by design" inside /(?{...})/ blocks.

Jarkko Hietaniemi provided a patch to significantly speed up case-related operations with UTF-8 strings (lc(), uc(), //i, etc.).

Christopher Madsen reported that Win32::GetOSVersion() was recently broken. It was repaired by Steve Hay. (Bug #27357.)

About this summary

This summary was written by Rafael Garcia-Suarez. Weekly summaries are published on and posted on a mailing list, which subscription address is Corrections and comments are welcome.