Useful Perl one-liners by @pkrumins

Useful One-Line Scripts for Perl                    Dec 03 2013 | version 1.10
--------------------------------                    -----------   ------------

Compiled by Peteris Krumins (, @pkrumins on Twitter) -- good coders code, great reuse

Latest version of this file is always at:

This file is also available in other languages:


    Please email me if you wish to translate it.

Perl One-Liners on Github:

    You can send me pull requests over GitHub! I accept bug fixes,
    new one-liners, translations and everything else related.

I have also written "Perl One-Liners Explained" ebook that's based on
this file. It explains all the one-liners here. Get it at:

No Starch Press has published "Perl One-Liners" as a real book too:

These one-liners work both on UNIX systems and Windows. Most likely your
UNIX system already has Perl. For Windows get the Strawberry Perl at: