PERL ONE-LINERS EXPLAINED PDF

The one-liners will make heavy use of Perl special variables. A few years ago I compiled all the Perl special variables in a single file and called it Perl special variable cheat-sheet. Print it! Awesome news: I have written an e-book based on this article series.

Author:Mulrajas Mooguzahn
Country:Malaysia
Language:English (Spanish)
Genre:Sex
Published (Last):17 March 2007
Pages:127
PDF File Size:9.88 Mb
ePub File Size:5.3 Mb
ISBN:169-7-31449-944-7
Downloads:72495
Price:Free* [*Free Regsitration Required]
Uploader:Gardajar



These one-liners will make heavy use of Perl special variables. Luckily, a few years ago I compiled all the special vars in a single file and called it Perl special variable cheat-sheet. I suggest that you print it so that you always had them in front of you and you could memorize them faster. Awesome news: I have written an e-book based on this article series.

Double space a file. There are three things to explain in this one-liner. The "-e" option can be used to enter a Perl program directly in the command line. By using "-e" you can handily specify the program to execute on the command line. Next the "-p" switch.

This way you can effectively modify all or some lines of input. It gets appended after every "print" operation. The input has been double-spaced. It was just the shortest possible one-liner that double-spaced the file.

Double space a file, except the blank lines. It does it by appending a newline character at the end of each line that is not blank. The "unless" means "if not".

The condition "beginning is end of line" is true only for lines that contain the newline character. The result is that every line that has at least one non-whitespace character tab, vertical tab, space, etc gets double spaced. Triple space a file. N-space a file. The "x" operator repeats the thing on the left N times. For example:.

D71055C DATASHEET PDF

Post navigation

I decided that there will be two new parts in this series. The most powerful feature in Perl is its regular expressions, therefore I will write a part on "Handy Perl regular expressions. Subscribe to my blog to know when that happens! Awesome news: I have written an e-book based on this article series.

ENVIRONMENTAL MANAGEMENT BY BALA KRISHNAMOORTHY PDF

Perl one-liners

These one-liners will make heavy use of Perl special variables. Luckily, a few years ago I compiled all the special vars in a single file and called it Perl special variable cheat-sheet. I suggest that you print it so that you always had them in front of you and you could memorize them faster. Awesome news: I have written an e-book based on this article series. Double space a file.

BEYMA CP 21 PDF

String Creation and Array Creation. Text Conversion and Substitution. Selective Printing and Deleting of Lines. Handy Regular Expressions.

Related Articles