Thomas A. Boyer wrote:
The original question was "how do I label my code as Perl 5?" The correct answer, according to Apocalypse 1, is to start your source with "package." If you didn't want to put your code in a package, then start it with "package main".

The other question was "how do I label my code as Perl 6?" The correct answer, according to Apocalypse 1, is to start your source with "module" or "class".

Here is the relevant paragraph from the apocalypse:
  I hereby declare that a |package| declaration at the front of a
  file unambiguously indicates you are parsing Perl 5 code. 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, but one
  thing I do know is that it'll set the current global namespace
  much like a |package| declaration does.

Righty-ho then. That's not actually all that bad, I'm used to starting files with 'module' in Haskell (where it's not always compulsory but is a good idea) so I'm sure I can cope with a similar thing in Perl 6.


Thanks



Reply via email to