Many of us are tied to really old Perl distributions, for a variety of reasons. Just because you’re using Perl from 1998 doesn’t mean you have to develop software like it’s 1998! This talk aims to help developers apply modern, maintainable approaches, even when you use 5.005;.
We’ll briefly discuss a bit of why people might be using ancient Perls, but mostly focus on some practical code examples. For example:
- named captures were introduced in Perl 5.10, but you can get a lot of their advantages by putting a hash slice on the left side of a capturing regex
- lexical filehandles were introduced in Perl 5.8, but you can use the Symbol module (in the standard distro!) to make your own lexical filehandles and dirhandles.
We’ll also talk about future-proofing (future resisting maybe..) your code. Maybe someday you’ll be able to update to a contemporary Perl release. If that day comes, you’ll be glad you:
- added use-version pragmas: use 5.005;
- use strict; Always. use warnings; except before 5.8. Then use #!perl -w