artist has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
I learned here that something will not work in perl 6.0 which are good in 5.6. ex..Re: Re: Aliasing a builtin? mentions difference of usage of $_. I have not transitioned towards 6.0, but I like to keep my coding practices in such a way that when the time comes, I don't have to change my coding practices radically apart from learning new features.
What I should keep in mind?

Thanks
artist

Replies are listed 'Best First'.
Re: Towards Perl 6.0
by Elian (Parson) on Mar 11, 2003 at 19:22 UTC
    If:
    1. You can't find reasonable documentation backing up the feature in perl 5
    2. The feature doesn't work in 5.005-style threaded perl
    3. The coding technique makes you think "Boy, that's really clever" (always a good warning in itself)
    odds are you'll have problems with it in perl 6. Not guarantees, but good warning signs.
      You could always install 6 on a testbed machine and check perldoc. I'll probably move up just because I like my stuff being up to date.
        Odds are I'd just go re-check the source, if I didn't remember off-hand as it was. (Assuming, of course, that I wasn't just emitting parrot assembly anyway) Joys of being deeply involved. :)
Re: Towards Perl 6.0
by TimToady (Parson) on Mar 12, 2003 at 22:49 UTC
    What you should keep in mind depends a great deal on how much the translator is able to translate current idioms into Perl 6 idioms. On your dynamically scoped $_ issue, it's not clear whether the translator will be smart enough to see that you've invoked length in a context where the $_ will certainly be undefined. If it is that smart, it could certainly install an argument of the form:
    sub len ($_ = $CALLER::_) { length }
    which has much the same effect as if $_ were dynamically scoped.
Re: Towards Perl 6.0
by pg (Canon) on Mar 11, 2003 at 20:31 UTC
    At the same time, don't worry too much about the compatibility issue, the designers of Perl 6 DO have compatibility in their mind all the time.

    If you don't believe me, believe this: Apocalypse 1.
Re: Towards Perl 6.0
by clairudjinn (Beadle) on Mar 11, 2003 at 22:51 UTC
    I think it really depends what you mean by coding practices. If you mean idiomatic perl coding, some of these will change, get much richer. Much of what is idiomatic now will be artifactual compared to working Perl6 code. So if you want to be able to understand and work with that Perl6 code, you need to adopt new coding practices by getting familiar with new features as you mentioned. Thems the breaks. But if by coding practices you mean the fundamentals of what constitutes solid, good code, I wouldn't worry too much. Things like design, modularity, documentation as you go, and so forth span all languages and their versions. By the way although backwards compatibility is indeed not forgotten by the Perl6 development process, one of the things that sparked Perl6 was the decision to *finally* step away from a pathological aversion to breaking old code. If you don't believe me, go here:

    Report on the Perl 6 Announcment