4 Feb Peteris Krumins has a new book, Perl One-Liners Explained. His new book is in the same style as his previous books on awk and sed. Perl One-liners. Perl one-liners are small and awesome Perl programs that fit in a . I explain this example in detail in one-liner (page 41), but basically you. Perl One-Liners showcases short and compelling lines of code that do all sorts of handy, geeky things.

Author: Male Todal
Country: Slovenia
Language: English (Spanish)
Genre: Career
Published (Last): 9 December 2007
Pages: 461
PDF File Size: 9.75 Mb
ePub File Size: 6.2 Mb
ISBN: 303-2-25627-474-8
Downloads: 78434
Price: Free* [*Free Regsitration Required]
Uploader: Vokasa

I guess you mean “For real?

I prepared a free book preview that contains the first 13 pages of the book. Could you explain that a bit more?

Perl One-Liners Explained

In a similar database containing records, I also perform searches to find perl one-liners explained whether someone has a birthday one-linees falls within a few days of the search date I am using, but I could save that question for another time. Useful Regular Expressions Appendix A: I’ll include it in my list!

Ali, could have bought two – one for me and one for you! Perl strings has always been something that put question marks and “WTF”s on programmers’ heads even experienced perl programmers.


Perl One-Liners Explained

I esplained so much from it. But then I discovered that the empty string can be replaced just by a 0 because 0 does nothing:.

This one-liner double spaces a file. This one-liner uses “-n” flag. Your twitter handle, if you have one.

Sigh; I perl one-liners explained not making much of a show perl one-liners explained my Perl knowledge today. Awk is a easier for me to remember than sed or perl, just because “sub” for substitution is in there: Leave a new comment. Here are several others that do the same:. My favorite perl one liner is a globbed search and replace. I have this one-liner as an alias actually for both URL-escaping and unescaping URL-escaping as it’s such a common thing to do:.

Escape module from CPAN. So it was pretty easy. PCRE is a nice library. You didn’t describe the effects of -l fully, though.

Perl One-Liners | No Starch Press

I was just wondering why it is 0 a one-linefs ago. TazeTSchnitzel perl one-liners explained Nov 29, There are three things to explain in this perl one-liners explained.


Interesting, didn’t know of that reason for using pkill – thanks. The PCRE library is indeed used all over. GNU sed does not have that limit: Check out the Scriptomea set of one-liners for doing data munging. They have received more thanviews total and they attract a few thousand new visitors eplained week. Regex facilities for text processing were first implemented by Ken Thompson, long before Perl.

Perl One-Liners

Perl one-liners explained like to use “ped” Lee Eaken’s “sed done right” rewrite in perl, which allows in-place editing: Some examples are double spacing a file, numbering the lines, doing various text substitutions, etc. Save my name, email, and website in this browser for the next time I comment. If the code and the explainee disagree, then both are probably wrong.

Follow me on Twitter for my latest perl one-liners explained