Thus spake Larry:
I hereby declare that a package declaration at the front of a file unambiguously indicates you are parsing Perl 5 code.
So muttering "package main" is *guaranteed* to produce the desired effect.
Also spake Larry:
If you want to write a Perl 6 module or class, it'll start with the keyword module or class. I don't know yet what the exact syntax of a module or a class declaration will be (my emphasis)
So while there will be some way of saying "this is perl6" we don't actually know what it is yet.
He goes on to say:
But note that the default in the main program (and in one liners) is Perl 5
Which it first glance would back up what you say. Except that I have been known to require a program into the middle of another or to read a file and eval it. Perhaps I'm being overly cautious, but to cope with weird edge-cases like that, and no doubt others I haven't thought of, adding an extra line to my program to say "this is old style code" does not seem overly burdensome. Think of it as just a bit more defensive programming. |