Preparing for Perl 7 (retired)


This book is no longer available for sale.

Preparing for Perl 7 (retired)

Level up to Perl 5.32 to be ready for Perl 7

About the Book

(I've "retired" this book. It looks like Perl 7 is not likely to happen, and even then, the advice from the time I published this is likely for a different universe of possibilities. If you still want to read this, let me know. I might repurpose the material by taking out the Perl 7 angle.)

Perl 7 will be essentially Perl 5, but with different default settings. You'll learn about the changes that have happened with Perl in the last decade and what you need to do to be compatible with v5.32. Along with that, you'll learn about the optional settings Perl 5 has and what you need to do when they are enabled by default rather than by request. You have plenty of time to ensure a smooth transition.

Much of this is basic best practice advice that benefits your Perl 5 programs even if you never make the jump to Perl 7. For instance, the strict and warnings features will automatically be enabled. Handle those in your existing code and you should have more robust programs, giving you more confidence in your work.

About the Author

brian d foy
brian d foy

brian d foy is one of the most profilic authors in the Perl programming community. He's the author of Mastering Perl and Learning Perl 6, and the co-author of Learning Perl, Intermediate Perl, Programming Perl, Effective Perl Programming, and others. He helps people and companies use Perl through education, training, and consulting.

brian d foy

Episode 265

Table of Contents

  • Preface
    • How to read this book
    • The ebook experience
    • Prior Perl experience
    • A note on links
    • Other books that may help
    • What about Perl 6?
    • About the publisher
    • Acknowledgments
    • Other books by brian
  • Introduction
    • A new social contract
    • Coexistence
    • The history of major releases
    • A path forward
    • Managing the change
    • Upgrading legacy Perl
  • Quick and dirty
    • The quick advice
      • Declare a minimum version of Perl
      • Upgrade to at least v5.30
      • Strict
      • Warnings
      • Bareword filehandles
      • Signatures
      • Prototypes
      • Indirect objects
      • Multidimensional array emulation
      • Unicode
  • Helpful Perl features
    • Load modules from the command line
  • Perl::Critic
    • Set up Perl::Critic
    • A Perl 7 profile
      • A warning about dynamic policies
    • Further reading
  • Strict parsing
    • Strict categories
      • Soft references
      • Poetry mode
      • Variable declarations
      • All together now
    • What you need to do now
    • What we don't know yet
    • Further reading
  • Warnings
    • The warnings pragma
      • Warning categories
    • Old school warnings
    • A bit of wisdom
      • Fatal warnings
    • What you need to do now
      • Test for warnings
    • What we don't know yet
    • Further reading
  • No bareword filehandles
    • The problem with barewords
      • The standard filehandles
    • Autovivified handles
    • What you need to do now
    • What we don't know yet
    • Further reading
  • Prototypes
    • Hints for the parser
    • The :prototype attribute
    • What you need to do now
      • If you are using prototypes
      • Updating my modules
      • Set prototypes with Sub::Util
    • What we don't know yet
    • Further reading
  • Subroutine signatures
    • What you need to do now
    • What we don't know yet
    • Further reading
  • No indirect objects
    • Indirect object notation
    • Turn off indirect notation
      • Indirect filehandles
    • What you need to do now
    • What we don't know yet
    • Further reading
  • No Perl 4-style multidimensional arrays
    • Concatenating indices
      • Sparse arrays
    • What you should do now
      • Proper multidimensional arrays
    • What we don't know yet
    • Further reading
  • Unicode
    • Think about encodings
    • Your source code
    • Output encoding
      • Single filehandles
      • New filehandles
    • Input encoding
      • Command-line arguments
      • Filenames
    • The -C switch
    • What you need to do now
    • What we don't know yet
    • Further Reading
  • Miscellaneous features
    • Stop doing these things
      • 0 .. "-1"
      • Changing the array base
      • False postfix conditions
      • Unescaped literal left brace
      • Unquoted empty heredoc terminators
      • Smart-match, given-when
      • dot in @INC
      • Lexical $_
      • autoderef
      • Vertical tab in \s
      • Expanded character class definitions
  • Compatibility mode
    • Short term coexistence
      • Rewriting shebang lines
    • Choose your Perl
      • Specify your protocol
    • module::compatibility
  • Conclusion
    • Fix that code
    • Promote Perl 7
      • Respond to questions about Perl 6
    • Open questions
  • Table for features
  • Changes to the book
    • The changes
      • July 9, 2020
      • July 5, 2020
      • June 24, 2020

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub