One-Liners
25 published questions
What you’ll find here
- Short, practical answers with runnable Perl code blocks.
- Sandbox-verified output (proof that the example actually runs).
- Notes on common pitfalls and version differences.
- intermediate • 2025-12-30How to ROT13 encode text using perl -pe?
- intermediate • 2025-12-30How to print matching groups from regex with perl -ne?
- intermediate • 2025-12-30How to generate random password using perl -e?
- beginner • 2025-12-30How to convert hex to decimal with perl one-liner?
- beginner • 2025-12-30How to trim whitespace from lines using perl -pe?
- intermediate • 2025-12-30How to shuffle lines randomly with perl one-liner?
- intermediate • 2025-12-30How to print every Nth line with perl one-liner?
- beginner • 2025-12-30How to count occurrences of a pattern using perl -ne?
- intermediate • 2025-12-30How to print lines between two patterns using perl -ne?
- beginner • 2025-12-30How to convert CSV to TSV using perl -pe?
- beginner • 2025-12-30How to reverse lines in a file using perl -e?
- intermediate • 2025-12-30How to print unique lines with perl one-liner?
- beginner • 2025-12-30How to replace spaces with underscores using perl -pe?
- intermediate • 2025-12-30How to extract IP addresses from log with perl one-liner?
- beginner • 2025-12-30How to number lines in a file using perl -ne?
- beginner • 2025-12-30How to delete lines matching a pattern with perl one-liner?
- beginner • 2025-12-30How to convert uppercase to lowercase with perl -pe?
- beginner • 2025-12-30How to print specific columns with perl -a?
- intermediate • 2025-12-30How to sum numbers in a file using perl one-liner?
- intermediate • 2025-12-30How to replace text in-place across files with perl -pi?
- beginner • 2025-12-30How to use perl -e to print lines containing a pattern?
- intermediate • 2025-12-29How to use Perl one-liners to find and replace across files
- intermediate • 2025-12-29How to process CSV files with Perl one-liners
- intermediate • 2025-12-29How to write a one-liner to sum numbers in a file
- intermediate • 2025-12-29How to write a Perl one-liner to replace text in files