[kw-pm] is perl 6 really that different?

Daniel R. Allen da at coder.com
Wed Jul 9 11:05:23 CDT 2003


Regarding compatibility between perl5 and 6:

6 will have a compatibility mode to read perl5 code.
See Apocolypse 1.  A quote:

"A closely related question is how Perl is going to recognize when it has
accidentally been fed Perl 5 code rather than Perl 6 code. It would be
rather bad to suddenly give working code a brand new set of semantics. The
answer, I believe, is that it has to be impossible by definition to
accidentally feed Perl 5 code to Perl 6. That is, Perl 6 must assume it is
being fed Perl 5 code until it knows otherwise. And that implies that we
must have some declaration that unambiguously declares the code to be Perl
6"

Robert, I'm curious what the book on perl6 says on the topic.  I'll be
surprised if this idea got abandoned.

Regarding @foo[0] vs $foo[0]:

On Tue, 8 Jul 2003, Robert P. J. Day wrote:
> On Tue, 8 Jul 2003, Simon Law wrote:
> > On Tue, Jul 08, 2003 at 08:19:29PM -0400, Robert P. J. Day wrote:
>
> > > really.  i'm not making this up.  i've seen this example in at
> > > least two different places as an example of what can go wrong
> > > if you confuse the proper way to refer to an array element in
> > > perl 5.
> >
> > Nope.  Are you sure that it isn't caught by use warnings and use
> > strict?
>
> oh, it may very well get flagged, but it does work that way,
> nonetheless.  wish i could remember where i read it first.
> perhaps "effective programming in perl".  the book with 50
> tips/hints for good perl programming.

OK, the note is worth making.  "If you don't use warnings, and you
expect @foo[0] to act the same as $foo[0], you're doubly screwed."

Not oddly, I've never noticed this behaviour, because I tend to use
warnings.

-Daniel

http://coder.com/ - Prescient Code Solutions - (519) 575-3733 da at coder.com






More information about the kw-pm mailing list