9 ms·
I am wondering why it is as it is. I think it may be because of perls abundance of short cryptic symbols that people feel somehow "proud" to 1) know what "while
by buster 14y ago
I am wondering why it is as it is. I think it may be because of perls abundance of short cryptic symbols that people feel somehow "proud" to 1) know what "while(<>){print if($.==2 || $& && !$x++); $.=0 if (/^--+$/)}" does and 2) to make it even shorter. Because with )(!§&/$?(=)% with hell a lot of meanings you could write entire perl scripts based on special characters.
A good example is http://www.nntp.perl.org/group/perl.beginners/2009/01/msg106031.html http://www.nntp.perl.org/group/perl.beginners/2009/01/msg106... that i just found googling for perl one liners. The OP want's to know what this line does, the first answer is "you can make it even shorter!". Somewhat explains what i try to say ;)
Surely there is a lot of clean perl code out there but from my experience at customers (i'm consultant) what happens in-house in some development departments looks very very very different. Then again i've seen a lot broken, half-tested and unmaintained CPAN modules as well.
- draegtun 14y agoOne liners are an (extreme!) optimisation and programmers feel quite proud when they able to optimise code :) And it's not restricted to Perl: http://news.ycombinator.com/item?id=4906370 http://news.ycombinator.com/item?id=4906370 > Then again i've seen a lot broken, half-tested and unmaintained CPAN modules as well. You also get this in PyPi, Gems, NPM, etc. Just more proof that Sturgeon's Law exists.