Earlier quoted context omitted.
Perl is still the only language I've seen that has a dedicated syntax for regular expressions. Every other language requires you to write your regexes as strings, which puts you squarely in backslash hell. (I'm sure there must be other languages with dedicated regex syntax, but I'm not aware of any.)
> Perl is still the only language I've seen that has a dedicated syntax for regular expressions. So, you've never seen Ruby?
Perl 5.26.0 released
161–165 of 165 posts
Re: Perl 5.26.0 released
#162Earlier quoted context omitted.
http://modulecounts.com
Which python module lets me declare object methods like: method foo(bar): self.do_foo(bar+self.baz) ? Because I get tired of all those selfs
You could try to monkeypatch it by creating a decorator that will mess around with the closures of methods to make it work, but I don't understand _why_ you would want to do that.
Re: Perl 5.26.0 released
#163Earlier quoted context omitted.
…is the answer 'the downvotes module'?
Downvoters: ok I get it: never post anything that's not a glowing recommendation of Python or an attempt to learn more about available modules/distributions.
> Please resist commenting about being downvoted. It never does any good, and it makes boring reading.
Re: Perl 5.26.0 released
#164Earlier quoted context omitted.
I think perl invites a kind of mindset from how the language is and how the initial community was. Why does it have something called 'say' instead of something more intuitive like 'println'. Then there are worse examples: carp, cluck, croak. These are commonly used. They are from the same module of course. There is also Moo, Moose. I'm not sure but was there something called 'Mo' too? Commonly used of course but as y…
"Why does it have something called 'say' instead of something more intuitive like 'println'." 'say' is a lot more intuitive than 'println' for me. In the former case, I'm telling my program to say something. In the latter case, I'm telling it to... print? What if I don't have a printer? And what's a 'ln'? Line? Loan? Loon? In other words, 'println' is not "intuitive". The word you're looking for is "conventional" or…
Re: Perl 5.26.0 released
#165Earlier quoted context omitted.
"Why does it have something called 'say' instead of something more intuitive like 'println'." 'say' is a lot more intuitive than 'println' for me. In the former case, I'm telling my program to say something. In the latter case, I'm telling it to... print? What if I don't have a printer? And what's a 'ln'? Line? Loan? Loon? In other words, 'println' is not "intuitive". The word you're looking for is "conventional" or…
... which is basically just blessed hashes.
But yeah. Perl 5's flavor of object-orientation is remarkable for exposing the inner workings of objects to the programmer. Fields are just hash table items. Methods are just subs that take the object as the first parameter. Classes are just namespaces/modules full of methods and constructors. Constructors are just ordinary subs that return blessed data structures.
It's all remarkably simple and elegant once you're used to it.