This Week on perl5-porters (1-7 September 2003)

rafael on 2003-09-08T20:29:00

September begins, holidays are over. Lots of little new things occured this week. Read about lexical pragmas, syntax warnings and good style, advancement of the maintainance branches, bugs, fixes, tests and upgrades.

Extensible lexical pragmas

Mark-Jason Dominus, in a sudden and impressive burst of creativity, posted a patch to implement extensible lexical pragmas in Perl 5. So what does this mean ? Basically he found a way to store, during the compilation of a Perl 5 program, variables related to lexical scopes, that can later be retrieved and used. Currently perl does this fully for some pragmas only (use strict 'refs', use integer, etc.) and in a non-extensible way. Moreover Mark-Jason's implementation provides a pragma module which goal is to help the future authors of lexical pragmas.

However, this patch is not finished, and has to be carefully tested and improved. It's a very promising starting point, though.

    http://xrl.us/sos 

First snapshot of 5.6.2

While the work on 5.8.1 testing and stabilization is continuing, Rafael released a first snapshot of what should become perl 5.6.2 in a not too long amount of time. This led to tests and fixes. Yves Orton provided a fix to MakeMaker on Windows. Rafael decided to copy the platform-specific configuration hint files from bleadperl to 5.6.2.

    http://xrl.us/sot 

print (...) interpreted as function

Abigail finds the above warning unuseful and demands it to be removed, on the basis of three considerations : it's issued for sensible and valid code, such as

    print (3);

Moreover it's not issued for some buggy code, where it should be issued :

    print  (1 + 2) * 3;    # note the two spaces after print here

and finally the statement print(1+2)*3 already gives the warning Useless use of multiplication (*) in void context. Also, sort() is subject to the same warning, but no other built-in.

As expected, the porters quickly divide into two camps. Abigail provided a patch to suppress the warning, but no verdict was given.

    http://xrl.us/sou 

map in void context

This wasn't the only controversial discussion. Tassilo von Parseval, following a piece of opinion posted by Abigail on comp.lang.perl.misc, provided a patch to optimize away the result of map when it's called in void context, making it almost as fast as a for loop. A discussion on the stylistic use of map in void context ensued, raising the question of whether it should trigger a warning or not.

    http://xrl.us/sov 

Order of evaluation

Mark-Jason Dominus asks whether the order of evaluation of some binary operators is defined ; for example, whether the . concatenation operator guarantees that its left-hand side will be evaluated before its right-hand side. The question is more about the future implementations of Perl (or Ponie) than about the past ones. The answer is undefined.

    http://xrl.us/sow 

Safe holes

Guy Albertelli demonstrated that within a string of perl code to be evaluated by Safe::reval(), some lexical variables from Safe were available. (Bug #23656.) This is related to the fact that eval'ed code sees its lexical context. As perl 5.8.1 contains fixes that allow nested evals to still see their full lexical scope, this bug is actually more serious in 5.8.1 than in previous versions. Hopefully, Dave Mitchell provided a fix.

    http://xrl.us/sox 

Moreover, Benjamin Goldberg found out that it's possible to exit from a block evaluated in a Safe compartment by using last LABEL or another similar construct (provided that LABEL is a valid label in the program at the point where the Safe compartment is used.)

    http://xrl.us/soy 

In Brief

Abhijit Menon-Sen provided a patch to implement a new syntax, <DIRHANDLE>, making the angle-bracket operator an equivalent of readdir() when operating over a directory handle. Mark-Jason Dominus provided a link to an old discussion in comp.lang.perl.moderated about the potential problems caused by this feature.

    http://xrl.us/soz 

Yitzchak Scott-Thoennes posted a patch to document that the import and unimport methods don't get autoloaded. But, at the same, he asks why they aren't autoloaded.

    http://xrl.us/so2 

Jarkko Hietaniemi asks the brave porters to fetch the patches to perl some OS vendors apply to their distributions, just to see if something interesting can be found.

    http://xrl.us/so3 

Andreas Koenig wrote a test framework for the perl debugger. (There are currently no regression tests for it.)

Enache Adrian is continuing his work on the ByteLoader module, which apparently is taking a good shape. It was completely broken in 5.8.0.

David Dyck reports (bug #23731) than on his Linux machine, the string returned by perl to represent the infinite IEEE floating point value has leading spaces. That would be a libc bug.

Unicode::Collate version 0.27, then 0.28, were released, as well as Data::Dumper 2.121. This last one, backported to perl 5.6 by Ilya Martynov, was integrated into perl 5.6.2.

The perlreftut manpage is now distributed under the same terms as perl itself. That means that it can be reintegrated into Debian.

About this summary

This week's discussions were summarized by Rafael Garcia-Suarez. Summaries are published weekly on http://use.perl.org/ and on a mailing list, which subscription address is perl5-summary-subscribe@perl.org . Corrections and comments are welcome.