Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Announcing my third e-book "Perl One-Liners Explained" (catonmat.net)
41 points by pkrumins on Feb 1, 2012 | hide | past | favorite | 6 comments


Perl one-liners are a great way to learn more about Perl -- there is a lot of uncommon syntax that makes some of the more advanced examples more like little puzzles.

However, if you are not familiar with Perl, and fall to the common stigma that Perl is unreadable, I urge you to delve more into the modern Perl community. The community doesn't have the same tendencies towards built-in obfuscation anymore.


Minor quibble but on his second example:

> perl -le 'print map { ("a".."z")[rand 26] } 1..8'

The double quotes are not needed around a and z. (Verified in 5.14, 5.12, and the truly ancient 5.8).


Certainly; they're barewords interpreted as string literals. The strict pragma forbids this interpretation.


Yup, that's explained in the book, section 5.1. :)


Yes, I was just now reading the PDF book excerpt and came to note that there are no quotes in the example as it appears in the book, on page 4. The book looks like a great balance between fun and sheer density of information, a reference book that manages to be a delight to read.


That's correct. The density of information approaches the theoretical maximum. ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: