Enable strict and warnings in Perl 5 scripts and modules
Add Perl 5's core strict and warnings pragmas to catch typos, undefined values, and unsafe references before they reach production.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Add Perl 5's core strict and warnings pragmas to catch typos, undefined values, and unsafe references before they reach production.
Stop swallowing file errors in Perl. Learn how the autodie pragma turns open, read, write, and system calls into automatic die statements, simplifying error handling while preserving context.
A practical guide to choosing between Perl’s DBI and DBIx::Class for database access. Compare control, performance, and maintenance, then see a concrete example that validates each approach.
Use DBI placeholders to separate SQL code from user data and stop injection before it reaches your database.
Replace manual @_ shifting with stable subroutine signatures in Perl 5.36+, including defaults and slurpy parameters, with caveats for type validation.
Perl's non-greedy quantifiers (*?, +?, {n,m}?) stop at the first valid match instead of consuming everything possible. This post shows why greedy matching fails on delimited text, demonstrates a configuration-parsing example, and explains backtracking risks.
Learn to extract delimited data in Perl using non-greedy capture groups. This guide covers the greedy vs non-greedy quantifier behavior, multi-line matching with /s modifier, global extraction with /g, and practical verification techniques.
Stop manually unpacking @_ in Perl. Learn how to use subroutine signatures to create self-documenting functions with default values and slurpy parameters.
Learn how to use Perl's Taint mode (-T) to create a hard security boundary between untrusted user input and system-level execution to prevent injection attacks.