7 ms·
What is Modern Perl
- sausagefeet 14y agoI really wanted to see what Modern Perl looks like.
- simcop2387 14y agoHave a look at http://onyxneon.com/books/modern_perl/ http://onyxneon.com/books/modern_perl/ This is from the author of the book, there's a nice pdf preview there to show the book off and a way to buy it.
- autarch 14y agoIt's actually more than a preview. The entire book is available free of charge in a variety of electronic formats (PDF, ebook, etc.).
- mhd 14y agoPreview is a slight understatement, it's the full book as both pdf and epub. It is a bit of a marketing term, though. Not many of the "modern" features are really new to Perl, but basically rather common modules. In the case of Moose, they do change the language use significantly, but mostly it's about showing that Perl can be used beyond small, one-file Unix scripts. And it's been able to do that for quite a while, the Perl 4 days are long gone. Still, getting some new-found traction is important, and popularizing some great CPAN modules definitely won't hurt.
- dwoldrich 14y agoThere's also the Modern Perl Books blog which delights in rooting around the guts of modern perl (and modern perl debates) -- http://www.modernperlbooks.com/ http://www.modernperlbooks.com/ :)
- kamaal 14y agoI started using Perl around 2006'ish, that was pretty late in the day compared to most Perl hackers. I was primarily a C/C++ Dev, going the OO way. And I was doing Java here and there. Until one morning a colleague of mine, saw me doing some stuff I was taking really long to finish. He just walked up to my cubicle and just said 'Why dont you use Perl to do this' and then started my crazy journey with Perl. What I really like about languages like Perl/Python and Ruby is how quickly you can go from learning to building something really useful. Perl has seen atleast 3 major rise in its popularity since its inception. First one among sysadmins, its from these days that you will powerful terse, small but elegant solutions to a range of problems. If you ever get a chance, do browse and read essays from Tom christiansen written during those times. They are just pure gem. The second was during Perl/CGI days. And third was the most recent with the Modern Perl movement. Much of the thanks for this goes to People like Chromatic, Audrey, People of p5p, Moose devs and etc. From each of those times, you will see varying variety of code written. Starting from really amazing one liners to at times some frustrating code during the dot com bubble, to now where Perl code really looks very nice. Modern Perl really is set of many successful sub projects. And its not just code, it covers everything. Code is just the beginning. To give you an example, these days you have very nice cpan package managers. You can search packages using Metacpan in a very user friendly GUI with nice syntax highlighting. You have awesome documentation, Modern Perl book really is the Perl's equivalent of the K&R book. There is Moose, And there are things like Class::MOP. There are things like DBIx::Class. In terms of other new breath taking stuff you will see things like Devel::Declare. This allows new syntax extensions to be written using Perl itself. Then as a result you have a range of modules like Moosex::<extensions>,Try::Catch, Gather::Take etc. In terms of web frameworks your have Catalyst. So its really these many many successful subprojects together which form 'Modern Perl', if you wish to describe it that way. Its no one thing. Code, documentation, culture, events, infrastructure etc etc all together form the 'Modern Perl' thing. If you come to the Perl core development, then they have real good time based releases. They are fixing bugs, adding new features, and doing a lot of amazing stuff. There have been pretty neat syntax features added in the past few releases and I guess much of Perl 6 based features will continually seep into Perl 5 as needed over time. Modern Perl, or other wise. Perl continues to retain its niche. Which is text heavy lifting, automation, rapid prototyping, development, a deep learing curve and larger gains in productivity with time. Its still the go-to tool for most back end tasks. If you wish to get something done faster, with little effort, sanely with little bugs in say over a weekend, You have little alternatives apart from Perl. If you are in dev ops and you have P1 tickets standing on your head pretty often, a tool like Perl is indispensible. And most importantly its areas of strengths are only growing- Unicode, regular expressions, CPAN, powerful syntax etc. If you ever get a chance Higher Order Perl is one book you must read. It really opens your mind to elegant solution to a range of problems. But like every other language, you need to invest time and effort incrementally to keep yourself updated.
- alrondy 14y agoIn perl culture, "Modern Perl" refers to bad programming by a core group of egocentric, sanctimonious developers who are to Perl what Lennart Poettering is to Linux. There are now dozens of CPAN modules with names like "common::sense" and "Modern::Perl" that provide no useful code, but introduce packaging dependencies and administrative overhead in the name of not having to type "use strict;" out by hand. Modern Perl is using Moose::Any instead of just using a language that does what you want. Modern Perl involves an average of 130 CPAN dependencies for any give application. Modern Perl is when perl stopped being perl and started being awful.
- einhverfr 14y agoNobody forces you to use Moose or anything else. I happen to think Moose is wonderful because it gives you a very useful declarative constraint system in a dynamically typed language, and it does so without messing up your ability to use other things like Template::Toolkit. But a lot of these things are not for all projects. I use Moose but not DBIx::Class in most of my projects. I think Moose is wonderfully designed, but that's just me. you may differ in your opinion and build your own modules your way. There's more than one way to do it!
- gatlin 14y agoI actually despise Moose as much as I despise blindly over-doing OO. To me Modern Perl meant tackling problems in a much more Lisp-inspired way (via lexical scoping, anonymous functions, closures, lists, etc) ... but in Perl. Kind of like "Higher Order Perl." I had the impression it was more a cultural shift, a renewed interest in Perl and people wielding it much differently. There's a different CPAN web interface[1], a lighter cli client[2], and everyone is on GitHub and writing hundreds of tests. I guess Moose is part of that shift but I'm torn a lot of the time - I support modern Perl but I hesitate to support blindly copying the warts from other languages just to appear modern. This[3] is a result of searching for common::sense ... yikes. [1]: http://metacpan.org http://metacpan.org [2]: https://metacpan.org/module/App::cpanminus https://metacpan.org/module/App::cpanminus [3]: https://metacpan.org/module/Real::Handy https://metacpan.org/module/Real::Handy
- 14y ago
- smugengineer69 14y agoWhat is modern Perl? Python. (I'll elaborate more here from my earlier one-word answer). Long-time perl programmer here, until I found Python. Perl is powerful, but Perl is for the programmer, not the programmer's coworkers. It's not even for the programmer 6 months down the line. This is nothing new, and it has become a stereotype in the community. Yes, this argument has been made and refuted many times, but I argue the reason isn't the language, but the dominant language paradigms. Perl's "monk" ideal is not sustainable in the long term, and encourages "clever hackers" who can do things with the fewest lines of fundamentally unreadable code. Yes, the language has evolved. Yes, it is slightly easier to read now. But the goals of the community still tend toward the ideals of becoming a master of arcana who can pass his wisdom down to the less experienced. Give me a language that the commoners can read, that a beginning programmer can feel empowered to learn because he can take one look at the source code of someone truly experienced and know at least a part of what is going on. You can change Perl all you want, but you cannot get away from the fundamental guiding principles of the language, which encourage antisocial, clever, and magic code.
- einhverfr 14y agoI rarely resort to magic code in Perl. I sometimes do because I can't find a better way to do it, and then I comment it as such. Comments are wonderful things when used properly.... If only more programmers in any language used them properly... I have seen so much really wonderful, readible, maintainable Perl code, that I don't think your characterization works. You know if I come back a couple months later and don't like my code, I rewrite it based on my objections. It doesn't happen often but it does sometimes. It happens in any language. If you value maintainability, you will eventually write maintainable code. The only flaw Perl has is in promoting valuing getting things done more than maintainability, but that's a culture of programmers, not the language. You can get good groups together than can write beautiful, maintainable code. I have done it. I know.
- webreac 14y agoPerl is for having work done in a minimal time. If you want to write code that is easy to read, learn Ada. Python is probably a better balance. Perl is wonderful for all the small scripts I need every days. When something needs to be reused, it become a module with a good documentation. I think nobody should read perl code except: - to learn how to code. - to modify a program you have written
- trebuch3t 14y agoWriting a book on Modern Perl is nuts. As the author of this post points out, there have been about twenty releases since Perl 5.6, when the book was published. Features like the "switch" and "state" keywords have been introduced. If you look away too quickly, another database interface crops up, or people are doing objects differently. Perl changes so often that writing about it is like trapping a unicorn. It's impressive that users of a 25-year-old language are not afraid to improve upon it (with the caveat that it stays backwards compatible). But since I started using $OTHER_LANGUAGE I don't have to worry about keeping up to date because language features change twice a decade.
- ajross 14y agoThat's a terrible straw man. Everything changes. Javascript is morphing into this weird "Coffee" thing before our eyes. Python pushed a completely new language and is currently supporting two of them. Even python 2.6 looks absolutely nothing like 2.0. People fled whole-hog from perl and python to ruby (another hardly static language) a few years ago, and most of those same people are now retraining their brains on that JavaCoffee thing I mentioned. C++? Yeah, brand new version out with whole new metaphors (An... rvalue reference?! And what is that -> operator doing there?). If you want compatibility, you have it. 15 year old perl scripts run fine on 5.14. If you want the community to not invent new stuff... dig yourself a hole I guess.
- Roboprog 14y agoYes, I'm so happy that Java, er, $OTHER_LANGUAGE, changes so (incredibly) slowly :-) Perhaps there is a happy medium somewhere between these extremes, though. (there seems to be just a bit of sarcasm in the above post, though -- writing about the moving Perl target is hard, but having a non-moving base one is employed to build on has its own "joys", as well)
- chromatic 14y agoWriting a book on Modern Perl is nuts. I've written two. Perl changes so often that writing about it is like trapping a unicorn. Not really. I document things with staying power. For example, I documented only the parts of smart match that are easy to explain. Everything else is up for debate, and thus not really worth recommending. (Besides, I'm not trying to replace the documentation.)
- chernevik 14y agoI'm torn between thinking there is value in learning some Perl and not really knowing that value might be. I've found a lot of embedded wisdom in the "old school" stack. If you edit in vi, add some sed / awk / grep, and learn some bash, you'll find these tools start to come together and leverage one another up substantially. Perl might be more post-Bell Labs but it still was written and used by smart people to Get Stuff Done. It stands to reason that there are large returns on learning it. But it isn't as approachable as Python. When I needed a glue language, I first looked at "Learning Perl" -- after a few days I concluded that, if this was The Path, then I would never get There. Python was much more approachable, and my code already gathers so many hacks that I'm glad my language forces me to make these at least somewhat intelligible. I would learn Perl faster now. But for what? I've learned some PHP to meet client demand, and for web development the next language would be RoR. I bet Perl is better than bash for various sysadmin and utility tasks, but bash feels good enough for the simple stuff I do. If I needed to do something really beyond bash I'd turn to Python, and I'm not sure why Perl would be better. I suspect there's a lot of general knowledge embedded in Perl but I'm not sure how that gets extracted and made current among today's toolset for the tasks I have. So to my mind, Perl is something of a sysadmin tool, better than bash and very useful for a workload focussed on system and file processing, on *nix, without much service to HTTP. I'd love to hear how it pays returns for people more focussed on back-end support of web development.
- adrianhoward 14y agoI'd love to hear how it pays returns for people more focussed on back-end support of web development. To pick one thing - Perl's testing infrastructure. It's just awesome. I miss it in other languages. See http://news.ycombinator.com/item?id=4040005 http://news.ycombinator.com/item?id=4040005 for a discussion.
- sliverstorm 14y agoI wouldn't sweat it if you are happy with Python. I haven't tried Python myself- I use Perl- but speaking to co-workers who prefer Python, when it comes to a glue language the two appear to be fairly interchangeable. There are some differences, but if all we are talking is glue, just go with what you like.
- gouranga 14y agoPython! Sorry couldn't resist.
- deleted 14y ago[deleted]
- jboggan 14y agoI started picking up Perl (as my first programming language) in 2003 while working in a genetics lab. I used it for years on a number of bioinformatics projects due to its strengths in tackling disparate sources of often irregular information. Recently I've been using it for the Kaggle Facebook competition simply because I can iterate my designs faster than in any other language. I'm looking forward to learning a few of these more newfangled modern appurtenances of Perl.
- r4vik 14y agoI actually own the domain modernperl,net, for trollish reasons actually (www.modernperl.net redirects to Ruby) but if anyone wants it / wants to do something useful with it. I'd be happy to transfer it to you for free.
- hippich 14y agoI think you might want to contact chromatic so this domain could be setup to redirect to his http://modernperlbooks.com/mt/index.html http://modernperlbooks.com/mt/index.html He gives away his ebook for free, so I guess giving him free domain might be very good for your karma :)