I would be dismayed if the solution reached meant that Perl 5 barfed with an odd error - if any Perl 6 program needs to be Perl 5 before Perl 6 is 'switched on', then I would think that the switch should be something that causes an obvious error in Perl 5 when run, so that the user knows that it is Perl 6 code. For example:

$ perl use 6.0; Perl v6.0.0 required (did you mean v6.000?)--this is only v5.8.1, stopped at - line 1.

To me, that looks fine. To have some kind of 'module Main;' requirement (as per Larry's last sentance) you get:

$ perl module Main; Can't locate object method "module" via package "Main" (perhaps you forgot to load "Main"?) at - line 1.

That just looks like something has broken. But, although 'use 6.0;' looks okay, it kinda fails the EXTEND test he sets out - it's not naturally there. In fact, I don't think there is anything naturally there in a Perl 5 program that you can use to do this. But, maybe Larry only raised that point in relation to modules.


In reply to Re: Re: Ensuring forward compatibility by kal
in thread Ensuring forward compatibility by DrHyde

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.