As a senior developer I work with Perl 5 every day. It’s my livelihood and my passion, but even though I love Perl, sometimes it makes my days dreary and dreadful. It’s a great language, it’s my language, but it’s not perfect. It doesn’t even have to be, I don’t believe there is something as a perfect programming language. They all have have their drawbacks, and Perl 5 is no different. That being said, there are a few features that I would love to have in Perl 5 because modern architecture requires these features to be able to program efficiently in the current environment.
Error solving - a major part of software development is bug fixing and to be able to handle this practically you need lots of warnings or a Perl debugger. I know it might not be possible, I know some of you might not want to hear this, but wouldn’t be great to have break points just like Java does? Perl has been the source of inspiration for many other language, but that doesn’t mean that we can’t look at others and borrow a few things.
Backward compatibility - if I download a module from CPAN right now I can’t be sure that it will work with my version of Perl. If I write a module and uploaded it to CPAN I can’t be sure that other programmers that use a different version of Perl 5 will be able to use. It would be awesome to have universal compatibility between different versions Perl 5.
Parallel sorting - Yes, I know, I’m looking at Java (8) again, but if it’s useful why shouldn’t I? The algorithm recursively breaks the array into pieces. Then it sorts them and then it recombines them concurrently and transparently. This is very useful when sorting large arrays. It would be great to have as a built in feature.
OOP is good - It’s as simple as that. It might be just my humble opinion, but Object Oriented Programming works better than simple procedural programming. Try to debug and fix a 15 year old non object oriented legacy code and then me tell how did it all work out. Although we do have some OOP coding in Perl, it’s not a default feature. Moose is great but this feature should be in the core of Perl 5 (I know we do have it in Perl 6 now).
Real OOP features - carrying on the same idea, I want to have real objects, real and complete interfaces, real abstract classes and private attributes and methods. The surrogate works, but we shouldn’t just settle with works, we should be great in Perl 5 as well. Perl 6 might have this, but right now it’s not fully production ready.
Switch clause - before settling in Perl 5, I worked in several other programming languages and most of them had a switch clause. We could use a performant switch clause without extra modules (Switch).
Asynchronous methods - this would be a time saver, running two or more methods at the same time, instead of waiting for each one in particular. Then collect the results correctly.
While doing some research for this article I managed to have a deeper look at Perl 6 among others. I know the last few features I mentioned exist in Perl 6, but right now that language is not fully production ready. Perl 5 is still the major player in the Perl family and it should have the same advantages that other modern programming languages have. These are just a few features that would help me in my daily development, if you do have some other suggestion please leave them in the comment section. Also I want to mention that Perl 6 looks really attractive to me right now and I hope it will get fully production ready as soon as possible. In the meantime, we still have Perl 5.Tweet