Live data from Hacker News

Not Your Grandfather’s Perl

stackoverflow.blog

121–130 of 257 posts

Re: Not Your Grandfather’s Perl

#121

I skimmed the article looking for a mention of a REPL or a new debugger. Perl is a great language but it lacks these tools. Sometimes I just want to try a couple of lines of Perl code in a REPL, but I cannot. Instead, I need to create a file. Also, when debugging with `perl -d`, I cannot use the Up arrow key to get the previous command. Not a big deal but the coding experience will be significantly improved with thos…

This is a simple REPL project and the readme lists other Perl REPLs.

https://github.com/viviparous/preplish

Perl's concise syntax makes working in a REPL a pleasure. Python has a REPL but the design of the language makes it expand both in length (for loops) and in width (tabs).

I am a recent convert to working in a REPL first to test programming ideas.

Re: Not Your Grandfather’s Perl

#122

With function signatures and state variables added in 5.010, I consider Perl feature-complete and have not really missed anything from it for as long as I've been writing Perl. What I do appreciate that's missing from many other languages and systems is the extreme committment to backwards compatibility. The knowledge that the next minor release won't break existing scripts is underrated, IMO. Solo project with ~23K…

Needs static typing. I'll let myself out now.

It's got static types. A scalar is a scalar is a scalar and never an array. Of course, scalar is a very broad type.

Re: Not Your Grandfather’s Perl

#123

Perl receives such an unnecessary amount of hate

I don't think it's hate. I think it's more "why would I choose Perl over Python?" Perl has a painful syntax, Python greatly improves on this with easy syntax. I don't want to have to relearn the syntax every time I reach for a scripting tool.

> Perl has a painful syntax, Python greatly improves on this with easy syntax.

I use Python and Perl. Some people who like Python want everything to be Python and "hate" anything that isn't Python. It approaches zealotry in some cases.

Perl syntax is expressive and is similar to C, C++, Java, and yes Bash. These are successful languages too despite not being pythonic.

Re: Not Your Grandfather’s Perl

#124
post #35

Earlier quoted context omitted.

I’ve had very limited contact with Perl, but for scripting purposes it does seem like the best option, so I intend to sit down to it and learn it better. It looks like a great next step after sed and awk (perl -pe). I love the ability to write terse scripts, reasonable speed for a scripting language and, as you said, backwards-compatibility (such a stark contrast compared to Python).

The "Learning Perl" book from O'Reilly is the best book to do this (and imho is one of the best written programming books).

Learning Perl is a classic of the form---the best intro programming book that I've ever seen, at least for smart readers who've done some kind of programming (any kind, with any language) in the past.

The contrast to Learning Python is noteworthy. The latter book is useful, too, but it's about ten times bigger and much less focused on introducing a language.

Re: Not Your Grandfather’s Perl

#125
Spent about 4 weeks learning perl at an internship 10 years ago. I believe that is one of the biggest professional mistakes I ever made. There is literally nothing I would recommend doing with perl over python.

Re: Not Your Grandfather’s Perl

#126

Perl receives such an unnecessary amount of hate

I don't think it's hate. I think it's more "why would I choose Perl over Python?" Perl has a painful syntax, Python greatly improves on this with easy syntax. I don't want to have to relearn the syntax every time I reach for a scripting tool.

> Perl has a painful syntax, Python greatly improves on this with easy syntax.

That's a matter of opinion. C style languages are a lot easier for me than whitespace significant languages; my editor will go to the matching bracket with ^G, but I can't do that with whitespace to get to the end of a block. The type sigils are a bit tricky to figure out, but if you spend the time to understand it, it makes sense (but that's also a mater of opinion, too).

Re: Not Your Grandfather’s Perl

#127
post #126

Earlier quoted context omitted.

I don't think it's hate. I think it's more "why would I choose Perl over Python?" Perl has a painful syntax, Python greatly improves on this with easy syntax. I don't want to have to relearn the syntax every time I reach for a scripting tool.

> Perl has a painful syntax, Python greatly improves on this with easy syntax. That's a matter of opinion. C style languages are a lot easier for me than whitespace significant languages; my editor will go to the matching bracket with ^G, but I can't do that with whitespace to get to the end of a block. The type sigils are a bit tricky to figure out, but if you spend the time to understand it, it makes sense (but tha…

Nobody complaining about Perl's syntax is complaining about the "C style". Reading the arcane incantations of magical $ variables gets really old really fast, Perl takes the "if it was hard to figure out then the code must be hard to read" to a whole new level. It's probably the only mainstream non-functional language where you can be absolutely unable to decypher a snippet of code even though you know another C-like language.

Re: Not Your Grandfather’s Perl

#128
Uh,those features are here for almost decade now, some longer IIRC.

But man, just being able to write

   use v5.10
have been a blessing when you need to support some legacy infrastructure. Old Python broke after upgrades, Ruby broke, but Perl code keeps on trucking.

In vast majority of cases the code changes were just "well, the new version of lib gives some warnings about deprecation, might as well clean it up a bit". The minority of cases has been Mojolicious breaking stuff again.

Re: Not Your Grandfather’s Perl

#129

With function signatures and state variables added in 5.010, I consider Perl feature-complete and have not really missed anything from it for as long as I've been writing Perl. What I do appreciate that's missing from many other languages and systems is the extreme committment to backwards compatibility. The knowledge that the next minor release won't break existing scripts is underrated, IMO. Solo project with ~23K…

One of my criteria for good tools is that they scale well from the smallest possible use case to absolutely massive. Git meets this criterion for example. Anyway I manage a 250kline code base written over 20 years which is in surprisingly good shape consider it's age and how many people have touched it. Last time we upgraded the perl for the first time in a decade - going through the addition of many features and maj…

"Perl makes easy things easy and hard things possible."

Re: Not Your Grandfather’s Perl

#130

Spent about 4 weeks learning perl at an internship 10 years ago. I believe that is one of the biggest professional mistakes I ever made. There is literally nothing I would recommend doing with perl over python.

Most Python code from 10 years ago won't run on modern distro.

Almost all Perl code will

Post reply on HN