Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?

by Corion (Patriarch)
on Oct 22, 2019 at 08:43 UTC ( [id://11107833]=note: print w/replies, xml ) Need Help??


in reply to Re: If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?
in thread If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?

I think you get that (and some more stuff) by having use 5.12; at the top of your script?

I think that the reluctance to having it opt-out is that it would break backwards compatibility in a big way.

  • Comment on Re^2: If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?
  • Download Code

Replies are listed 'Best First'.
Re^3: If Perl 5 were to become Perl 7, what (backward-compatible) features would you want to see?
by hippo (Bishop) on Oct 22, 2019 at 09:33 UTC

    If someone can't be bothered to use strict; use warnings; what makes you think they'll be bothered to use 5.12; instead? cavac's point was the on-by-default aspect and I agree that a major version bump is precisely the time to revisit such a beneficial but backwards-incompatible change.

    It's hardly such a great task to mitigate either. If someone really wanted to run code without the safety net then all they need to do is add no strict; no warnings; and they're done.

      Exactly. When/If we do a major version bump, we might as well make it easier for newcomers to the language.

      In my opinion, there are very few cases where "no strict" is useful - and pretty much everyone experienced enough to play around with those would "use strict" at the beginning of their code anyway and use the "no strict" directive in a narrow scope.

      And yes, i agree, making "use strict; use warnings;" the default might break some code. But frankly, if it doesn't work in strict mode, it's probably already broken beyond repair, just nobody has noticed because strict and warnings weren't turned on ;-)

      Heck, we might even throw in an automatic "use English" and change the docs to show that using the english name rather than cryptic stuff like "$!" is the way of the future.

      perl -e 'use MIME::Base64; print decode_base64("4pmsIE5ldmVyIGdvbm5hIGdpdmUgeW91IHVwCiAgTmV2ZXIgZ29ubmEgbGV0IHlvdSBkb3duLi4uIOKZqwo=");'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found