Hacker News new | ask | show | jobs
by orf 1378 days ago
Sorry, but what? The top features they highlight here are a print statement that adds a new line, a change to the bonkers default of creating some kind of implicit global named variable every time you open a file, representing time as an object (with a strftime function!) and… function signatures?

I wouldn’t call this as “Perl moving forward”, I’d call this “Perl is still about 20 years behind everyone else”.

Wait until they find out that other languages print statements let you customise the line ending!

4 comments

The `print` statement in perl has always behaved more or less as it does in the "other languages" you describe.

`say` removes the need for anyone to write their own "I'm tired of the manual newline ritual" function and provides a standard for where the newline is added. That's a marginal convenience, but given the frequency with which people either do write their own or newline inconsistency gets encountered (or both), it's a reasonable one.

And it's in pieces like this one not because it's a huge thing to crow about, but to illustrate the opt-in nature of incremental changes or sets of changes to perl.

`say` is also about 15 years old, like Time::Piece. The author is not announcing features that are new to the whole world, just new to a certain audience, possibly including the author.

This is also true of the filehandle scoping feature (which is 22 years old). If you find the old bare filehandle scope behavior only notable enough to hurl a drive-by "bonkers" at it then I suppose that's one way of advertising that you haven't spent much time thinking about unix shell utilities and associated features/issues.

Function signatures are slightly younger than typescript, or at least, the most familiar syntax for them; both the old and more recent means are essentially naming a list of arguments.

In general: perl is an opportunity to think about programming languages differently. There's a lot of contexts in which I never use it anymore, but it's rare to find people with substantial insights who casually disparage it.

Ya those were my thoughts exactly, and I used Perl heavily for several years.

The number two feature they listed was released more than 22 years ago.

Perl is fine for certain tasks, I have no problem with people who choose to use it, but at a certain point I'd argue it's better to learn a new language than try to use Perl for a new type of task.

It’s a weird feature set to highlight; most of this is available for a long time.

I didn’t know about the function signatures. It’s nice, I guess.

But I don’t want to write perl again anyway.

>“Perl is still about 20 years behind everyone else”

The version of Perl on your favorite Linux distro might be. I think that's the point the article was trying to make...that distros ship VERY old versions of Perl.