Most Perl 6 will look like Perl 5

Ovid publiustemp-londonpm at
Fri Jan 25 12:24:35 GMT 2008

--- Matt Johnson <mwj at> wrote:

> Most of that doesn't scare me, but the sigil change makes me want to
> run 
> screaming for the hills. Why completely change a paradigm that's
> worked 
> fine for many years (that the sigil designates the return type) -- to

Because experienced Perl programmers don't notice it, but it's one of
the biggest sources of confusion for programmers learning the language.
Randal's commented about how they restructured Stonehenge training
classes to work around student confusion regarding the sigil (this has
shown up in the llama book).  It's a shame that such a core feature of
the language has confused so many people, so Perl 6 attempts to get
around one of our biggest stumbling blocks.

In Perl 6, because the sigil is now part of the variable name, it no
longer indicates what the lvalue receives, or what we're referencing,
or whatever the hell it's doing.  @foo is an array, period. It's not
some weird hash pretending to be an array or anything.  Because sigils
will be invariant, we can get rid of the following abhorrent syntax:

  my @foo = @bar{ 1, 2 };
  my @foo = @bar[ 1, 2 ];

Most of us don't think twice about that, but that's awfully subtle for
a new programmer.  Now you get this:

  my @foo = %bar{ 1, 2 };
  my @foo = @bar[ 1, 2 ];

That's *much* easier to see.  It also cleans up dereferencing syntax,
but I'll stop now.  I suspect that going on would be akin to trying to
explain to Republicans why they should have liked Bill Clinton (he had
a record any Republic would have envied). 



Buy the book  -
Perl and CGI  -
Personal blog -
Tech blog     -

More information about the mailing list