Perl 5 Porters Weekly: July 1-7, 2013

Welcome to Perl 5 Porters Weekly, a summary of the email traffic of the perl5-porters email list.

Topics this week include:

  • Use of bare << to mean <<"" is deprecated
  • Perl 5.18 and Regexp::Grammars
  • key/value hash slices summary
  • postfix dereference syntax
  • Things that have been deprecated for a long time
  • Talk about deprecation...

Use of bare << to mean <<"" is deprecated

RJBS writes:

I see no value in keeping "bare <<" heredocs around, other than avoiding the breakage of a presumably small amount of code that, frankly, has had every opportunity to reform. There is no future in which I see the feature being appreciated and spared from the looming threat of removal. We should put it out of its misery and move on, freeing up discussion time for things of greater value.

So it's deprecated and to be removed in 5.20. This seems to have spawned a bunch of other threads about behaviors that have lingered on despite being quote deprecated unquote.

Read the thread

Perl 5.18 and Regexp::Grammars

One of things in 5.18 that broke Regexp::Grammars has been reverted. Dave Mitchell also suggested a potential path forward and sent it to Damian Conway for consideration, but there hasn't been a reply on P5P.

Read the thread

key/value hash slices summary

Ruslan Zakirov posted a collected summary on his hash slice syntax proposals.

Read the thread

postfix dereference syntax

This was a popular thread this week. Reactions to RJBS' email last week rolled in. I was particularly taken with this syntax proposal by David Golden:

$array->[]; # dereference
$array->[$i]; # single element
$array->[@list]; # array slice

$hash->{}; # dereference
$hash->{$n}; # single element
$hash->{@list}; # hash slice

But some others threw what may be a spanner in that proposal. There was a catch-all reply by RJBS here and there's even a patch by sprout awaiting testing.

Read the thread

Things that have been deprecated for a long time

Ed Avis collected a list of things that have been marked as "deprecated" but are still in the language.

Here's his list:

my $x if 0;                 # since 5.9.1
defined(@x) and defined(%h) # since 5.6.1 or earlier
sub foo {} do foo(1,2)      # since 5.10 or earlier
chdir('')                   # since 5.10 or earlier
%h->{a} and @a->[5]         # since 5.7.2; code committed 2001-05-08
?PATTERN?                   # since 5.10 or earlier
$[ = 5;                     # since 5.10 or earlier
dump                        # since 5.8
Unrecognized escape \8      # since 5.8
sub foo (@bar) {}           # since 5.8
::DESTROY                   # code committed 2002-03-16
use UNIVERSAL;              # since 5.004_02

Read the thread

Talk about deprecation...

To put the cap on the talk of deprecation this week, Yves Orton mentioned a serious wart in Perl since the days of Perl 4 from the comments in op.c

           /* perl4's way of mixing documentation and code
                (before the invention of POD) was based on a
                trick to mix nroff and perl code. The trick was
                built upon these three nroff macros being used in
                void context. The pink camel has the details in
                the script wrapman near page 319. */
                const char * const maybe_macro = SvPVX_const(sv);
                if (strnEQ(maybe_macro, "di", 2) ||
                    strnEQ(maybe_macro, "ds", 2) ||
                    strnEQ(maybe_macro, "ig", 2))
                        useless = NULL;
                else {

Read the thread

About Perl 5 Porters Summaries

user-pic Weekly p5p summaries