Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Ensuring forward compatibility

by Abigail-II (Bishop)
on Apr 14, 2004 at 12:38 UTC ( [id://345022]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Ensuring forward compatibility
in thread Ensuring forward compatibility

Maybe I should have been more explicit. My point wasn't that you should have read the apocalypse. My point was that you shouldn't spread FUD, suggesting that people should modify their perl5 programs. Putting a package main; on top of your programs is not necessary.

Abigail

Replies are listed 'Best First'.
Re: Re: Ensuring forward compatibility
by DrHyde (Prior) on Apr 14, 2004 at 15:10 UTC
    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.

      Think of it as just a bit more defensive programming.
      Do all the defensive programming you want, that's not what I'm arguing about. But defensive programming is quite different from your battlecry Go and do it today. Tell your friends. Get yourself ready for the shiny new perl6 world. That's pure FUD.

      Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://345022]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-18 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found