Home / Alt manpages / perl5203delta(1)

  • perl5203delta(1)
  • User command
  • linux

Check a Perl 5.20.3 Upgrade Without Guessing

You will finish with a short, evidence-based checklist for deciding whether a Perl 5.20.3 upgrade needs extra testing on your Linux system. It uses perl5203delta to separate interpreter changes from module updates, then turns the relevant bug fixes into small smoke tests. The document describes the change from Perl 5.20.2 to 5.20.3, not a general guide to the Perl version installed today.

Allow 20 to 30 minutes for a small application, longer if it uses XS modules, taint mode, threads, unusual regular expressions or UTF-8 identifiers. You need a shell, the installed Perl documentation package, and a copy of the application or test suite. The commands below only inspect files or run short Perl processes. No elevated privileges are required.

1. Record the Perl you are testing

Start by recording the interpreter and the relevant documentation package. This prevents a common distraction: reading a historical delta document and assuming it describes the interpreter that happens to be first in your PATH.

$ perl -v
$ perl -V | sed -n '1,12p'
$ man perl5203delta

The installed manpage on this system is generated for Perl 5.38.2, while its subject is the historical 5.20.2 to 5.20.3 release. Your first command should therefore tell you which binary your application will actually run. If man perl5203delta fails, install the documentation package provided by your distribution, usually named perl-doc, then repeat the command.

Checkpoint

Save the output of perl -V with the test record. It includes build and configuration details that can explain a platform-specific result later.

2. Read the delta by impact, not from top to bottom

Read the sections in this order: Selected Bug Fixes, Modules and Pragmata, Platform Support, then Documentation. The release has no changes intentionally incompatible with 5.20.2, but that does not mean every application is risk-free. A crash fix or a change in regular-expression behaviour can alter a program that was relying on a bug.

Mark a fix as relevant when your code uses one of these areas:

  • large tainted strings with repeated global matches, where an old performance problem could become a denial-of-service concern;
  • UTF-8 variable names, function names, here-document terminators or regular expressions;
  • possessive quantifiers with equal minimum and maximum bounds;
  • threads that clone an array and then extend it;
  • the special variable $/, warning fatality, setpgrp, or parsing around an unfinished bracket expression;
  • XS builds, h2ph, or 64-bit Visual C++ builds on Windows.

Do not turn an entry into a promise about every later Perl release. For example, the note about h2ph is specifically about hexadecimal constants in GCC's predefined macros, and the Win32 notes concern compiler and architecture combinations that do not apply to ordinary Linux builds.

3. Check the regular-expression regression you actually use

The 5.20.3 notes say that a possessive quantifier such as a{3,3}+ should behave like an equivalent atomic group, and that Perl 5.20 had a regression when the two bounds were equal. Run both forms against a small string:

$ perl -e 'print "possessive\n" if "aaa" =~ /a{3,3}+/; print "atomic\n" if "aaa" =~ /(?>a{3,3})/;'
possessive
atomic

This is a syntax and result check, not proof that your production expressions are safe. Copy the actual expressions from your test suite into isolated tests and compare the expected captures, backtracking behaviour and runtime before and after an interpreter change. Avoid testing only a short successful input: the delta calls out long strings and patterns beginning with a greedy wildcard as a performance area.

Checkpoint

The two labels above should both appear once. If they do not, stop and inspect the exact Perl binary, expression and locale used by the test.

4. Add focused tests for data and parser edge cases

Several fixes are easiest to cover with regression tests rather than a command-line demonstration. Make each test small enough that a failure identifies one language feature. For example, this checks that a failed assignment to $/ does not silently leave the visible value looking valid:

use strict;
use warnings;

local $/ = "\n";
my $before = $/;
my $error = eval { $/ = []; 1 };
die "assignment unexpectedly succeeded\n" if $error;
die "record separator changed\n" if $/ ne $before;
print "record separator preserved\n";

The exact warning and exception text is not a stable interface, so test the state your program depends on rather than matching diagnostic wording. Add separate tests for UTF-8 names and here-documents if your source uses them. Keep the source file encoded as UTF-8 and run it with the same command line and environment as the application.

Do not use malformed code copied from the delta as a production probe. The note about an expression such as /$a[/ describes a parser bug that could read another input line or crash older Perl versions. Put parser regressions in a disposable test file under your test suite, and never feed untrusted text to an evaluator merely to see how it parses.

5. Check module and build-sensitive changes

Compare the versions named in the document with the interpreter you will deploy. Perl 5.20.3 updated Errno, Module::CoreList and perl5db.pl. On a system that provides those modules, inspect the versions without changing anything:

$ perl -MErrno -e 'print "Errno $Errno::VERSION\n"'
$ perl -MModule::CoreList -e 'print "Module::CoreList $Module::CoreList::VERSION\n"'
$ perl -V:version

These commands report the modules belonging to the selected interpreter. They do not prove that a separately installed CPAN copy, an application bundle or a container image will use the same files. Run the application's dependency and test commands in the deployment environment as well.

If you build XS code or regenerate header wrappers, record the compiler and architecture. The 5.20.3 notes mention GCC 5 preprocessor line directives, hexadecimal compiler macros seen by $Config{cppsymbols}, and a 64-bit Visual C++ warning problem. Those are build checks, not reasons to change Linux compiler flags blindly.

6. Decide, document and recover

Keep the delta document, perl -V output, focused test results and application test report together. Record the interpreter path with command -v perl, because a successful shell test can still use a different Perl from the service manager or deployment image.

If the new interpreter fails a test, do not work around it by changing production code first. Re-run the test with the old and new interpreters, reduce it to the smallest input, and check whether the result is an expected correction of old behaviour. Roll back by restoring the previously tested Perl package or deployment image according to your package manager's normal change process. That rollback changes system state and may require elevated privileges, so take a package snapshot or deployment revision before upgrading and follow your local recovery procedure.

Report a suspected core defect with a minimal reproducer and the output of perl -V. Do not include credentials, customer data or proprietary source. For a security-sensitive Perl core issue, use the private reporting route documented by the Perl project rather than posting exploitable details publicly.

Done means

  • you recorded the Perl binary, version, build and module versions;
  • you mapped the delta entries to features your application actually uses;
  • the focused regular-expression and state-preservation tests pass on the target interpreter;
  • XS, compiler, UTF-8, taint, thread and platform-specific risks were either tested or marked not applicable;
  • you have a tested deployment revision to restore if the application suite fails after the upgrade.