Live data from Hacker News

Perl secret operators and constants

search.cpan.org

11–20 of 46 posts

Re: Perl secret operators and constants

#15
Perl is actually relatively easy to learn and get productive with. You can write it in several transitional styles depending on where you are coming from, and the community doesn't care all that much. It's a little bit like using "Basic English" [1] to program with.

But it's a really deep language, and not necessarily in ways that academic language designers want it to be. Perl always feels more like having a conversation with your computer than programming it. These kinds of operators are like having a whole host of additional highbrow verbs you can use in conversation if you want.

1 - https://simple.wikipedia.org/wiki/Main_Page

Re: Perl secret operators and constants

#16
post #3

Perl seems like a great language for a lot of text processing jobs, but while its learning curve isn't too steep, it goes on forever. I will continue to use it for quick little projects like cleaning up excel files, but I don't think I could ever get into things like Perl golf.

Perl golf is meant as a thought exercise. Code should be human readable. The compiler will cope with verbose code just as easily as terse code.

Re: Perl secret operators and constants

#19
post #12

I write perl everyday, I never use this stuff.

I use a few of them in javascript. In fact, Venus can be shortened to just "+", ie. +"123234" +"1e29" +"abc" // -> NaN

In Perl, no, because + is an unary identity operator, used e.g. to properly leave function call parentheses:

  print +(1 + 2) * 3;
  print ((1 + 2) * 3);
  print (1 + 2) * 3;
Post reply on HN