Over on LinkedIn, someone asked me “What core PERL[sic] features do you use regularly that are new since 95?” It’s hard to be sure as the perldelta files only seem to go back to 1997 (for example, when were qw(...), q(...) and qq(...) added?), but here’s a quick list off the top of my head.
- my was, of course, added in 5.0. But 5.004 added the ability to use it in control expressions – while (my $foo = <>) – and in foreach loops – foreach my $foo (@foos)
- use VERSION
- Regex extensions – (?<=RE) and similar. Oh, and qr/.../
- Data::Dumper (added in 5.005)
- Unicode support – first added in 5.6.0 and improved in every release since
- Three-argument open
- Omission of intermediate arrows in data structure lookups – $foo[$x][$y] instead of $foo[$x]->[$y]
- use warnings
- Test::More and Test::Simple
- use base (or, more recently, use parent)
- yada-yada operator
Have I missed anything obvious? What new Perl features do you use most?
I wrote an article for Josette called “What is Modern Perl?” In it, I talk about the different things that people might mean when they talk about Modern Perl and why it’s well worth buying a copy of the new edition of the camel book.
After a gap of twelve years, a new edition of Programming Perl (affectionately known as “the Camel book” to its many fans) was published earlier this year. That came as quite a surprise to many people who had given up on seeing a new edition. What has changed in the new edition? Does the book now cover Modern Perl? The answer depends on what you mean by the term “Modern Perl”.
Of course it’s not a complete coincidence that the subject ties in nicely with my forthcoming Modern Perl for Non-Perl Programmers course.
Update: There’s a discussion of the article on Hacker News. It seems to be taking a predictable path.
Over the weekend the postman bought me my subscribption copy of Linux Format issue 155. This contains the third (and final) part of my Modern Perl tutorial. In this part we’re adding features to the Dancer web application that we started in issue 153.
This series has concentrated on web applications (with Dancer) and database access (with DBIx::Class). I’ve already got provisional agreement for another short series later in the year – where I plan to cover OO programming using Moose.
The new issue will be in the shops later this week.
Yesterday’s post bought my subscription copy of Linux Format issue 153. This issue contains the second article in my short series about Modern Perl. In this article we take the simple DBIx::Class application that we wrote last time and put a web front end on it using Dancer.
Over the next few days I’ll be writing the third (and final) article in the series. This will involve adding more features to the web app.
If the series is successful (and please let LXF know if you liked it) then perhaps I’ll be asked back to write more next year.
LXF 153 should be appearing in all good newsagents next week.
The London Perl Workshop is in two weeks time. Have you registered yet? There are apparently 200 people signed up already.
I’m going to be there giving a training course in the morning. It’s called Modern Core Perl and it will introduce many of the new features that have been added to the Perl core since version 5.10.
The course is ninety minutes long and attendance is completely free (as it is for all of the workshop). I was planning to write a post encouraging people to sign-up for the course, but it seems that will be unnecessary. I already have twenty people signed up and until I know for sure how big the room is I’ve had to declare the class full as I don’t want to run the risk of people signing up and not being able to fit into the room.
Unfortunately, though, the workshop web site doesn’t really have the concept of signing up for courses. So it’s impossible to actually stop more people signing up for the course. In fact, two more people have signed up since I edited the description to say the course was full.
I hope that the room will be large enough to allow us to let a few more people in on the day, but we will be strict on not overcrowding the room.
I apologise in advance if you want to come to the course but can’t get in. Perhaps you’ll consider Ian’s course instead. Or there will be three or four tracks of other talks going on at the same time.