Cleaning Up Perl Subroutines with Native Signatures
Stop manually unpacking @_ in Perl. Learn how to use subroutine signatures to create self-documenting functions with default values and slurpy parameters.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
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.
Replace manual @_ unpacking with stable subroutine signatures in Perl 5.36, but check your interpreter version first.
Stop mojibake and wide-character warnings in Perl by setting default UTF-8 layers with the open pragma across standard handles and file I/O.
Perl's subroutine signatures are stable since 5.36. Here's what they replace, how arity checking catches silent bugs, and when @_ unpacking is still the right call.
A decision guide for Perl exception handling: compare eval/die, Try::Tiny, and the core try/catch feature, then validate your choice with a destructor-unwinding test.
A decision guide for Perl sorting: when the plain built-in sort is enough and when the Schwartzian transform pays off, with code, benchmarks, and memory trade-offs.
Stop cluttering your Perl scripts with manual newline characters. Learn how to use the Perl 'say' operator to simplify output, handle filehandles, and avoid namespace conflicts.
Perl 5.36 made subroutine signatures stable. They replace manual @_ unpacking with declared parameters, default values, and runtime arity checks — cutting boilerplate and catching call-site errors early. A worked config-loader example shows slurpy hashes and lazy defaults, plus the trade-offs.