Home / Alt manpages / perl583delta(1)

  • perl583delta(1)
  • User command
  • linux

Check What Perl 5.8.3 Changed Before You Trust an Old Script

You will leave with a short compatibility check for a Perl program that may have been written around the 5.8.3 release, plus a sensible way to read the perl583delta manual page. The page describes the change from Perl 5.8.2 to 5.8.3, not a command with switches that changes your interpreter.

Prerequisites: a shell, Perl, and the perl-doc package if you want the local manual page. Allow about 15 minutes for a first audit. No root access is needed for the checks below.

1. Establish which Perl will run the test

Start by recording the interpreter and its library search path. An old script can appear to work while loading modules from a different Perl installation.

command -v perl
perl -v
perl -V:version -V:archname -V:useshrplib

On this host, the installed interpreter reports Perl 5.38.2. That matters: the local perl583delta page is historical documentation, while the probes you run now exercise 5.38.2. A successful modern test does not prove that a Perl 5.8.3 binary had the same implementation details.

Checkpoint

Keep the reported version beside your test result. If the script must run on an old appliance, repeat the checks with that appliance's Perl rather than relying on your workstation.

2. Read the delta page as a version boundary

Open the installed page directly:

man 1 perl583delta

Its headline sections separate core enhancements, utility changes, selected bug fixes, and known problems. The page says there were no changes incompatible with 5.8.2. That is useful context, but it is not a promise that every old script is portable: modules, operating systems, compiler behaviour and local configuration can still differ.

The online copy is useful when the target machine has incomplete documentation: Perl's perl583delta documentation. Treat it as the same historical release note and compare it with the installed page when diagnosing a distribution-specific package.

3. Exercise the tied-hash change

Perl 5.8.3 added a SCALAR method for tied hashes. A tied hash is an object behind hash syntax, so an expression such as %cache in scalar context can invoke object code rather than behaving like an ordinary hash. The exact result depends on the tie implementation: the delta page says a custom SCALAR method is used, otherwise Perl checks the tie's iteration state or calls FIRSTKEY to determine emptiness.

This small probe makes the dispatch visible. It does not change a file or require a module:

package Demo;
sub TIEHASH { bless { data => { alpha => 1, beta => 2 } }, shift }
sub FIRSTKEY { my $s = shift; keys %{$s->{data}}; each %{$s->{data}} }
sub NEXTKEY  { my $s = shift; each %{$s->{data}} }
sub FETCH    { $_[0]->{data}{$_[1]} }
sub SCALAR   { print "SCALAR method called\n"; return scalar keys %{$_[0]->{data}} }

package main;
tie my %cache, "Demo";
print "truth=" . (%cache ? "true" : "false") . "\n";
print "value=$cache{alpha}\n";

Expected output is:

SCALAR method called
truth=true
value=1

The distraction to avoid is treating truth=true as a property of every tied hash. It is a result of this tie class implementing SCALAR. For a real cache or database tie, read its implementation and test the empty, populated and mid-each cases separately.

4. Check the utility changes without changing your filesystem

The release note records two command-line changes. find2perl gained an implicit -print action, and prove was introduced as a convenient runner for individual Perl regression tests. Verify what is installed before putting either into a build script:

command -v prove || true
prove --version
command -v find2perl || true

On this machine, prove is present and reports its version, while find2perl is not on PATH. That is a package-layout fact, not evidence that the documented historical behaviour is wrong. Do not silently substitute another file-search command in an old build: inspect the package contents and the script's expected generated Perl first.

To run a test file once you have identified a trusted path, use:

prove --verbose /path/to/project/t/example.t

Expected output is TAP-style test output ending in a passing result, normally with a line such as Result: PASS. A failure is evidence to investigate, not a reason to rerun a destructive test repeatedly. Read the test before running it if it writes databases, starts services or removes fixtures.

5. Separate release fixes from application assumptions

The page lists fixes for UTF-8 offsets after substr, mixed UTF-8 and 8-bit join calls, ranges with an undef endpoint, Unicode keys in tied hashes, and reading $^E without disturbing $!. These are regression-test targets, not switches to enable.

For each one that matters to your application, make a small test which states the expected value and run it under the actual deployment interpreter. Keep the test data local and ordinary. Do not use the old suidperl mechanism to reproduce privilege behaviour: the same page calls out a race opening scripts and says that suidperl was deprecated and not installed by default. If a script needs privilege separation, redesign it around the platform's supported service or privilege tooling.

The page also mentions detached Windows threads and old Red Hat 9 or HP-UX threading failures. Those notes do not describe a Linux 5.38.2 installation. Record them only when you are maintaining one of those environments, and verify the operating system and threading library before assigning blame to Perl.

6. Finish with a reproducible compatibility note

Save the command output in your normal test evidence, not in a system directory. Include the Perl version, architecture, module versions that the script actually loads, the relevant delta section, and the smallest passing or failing probe. This turns "it worked on Perl" into a result another person can reproduce.

If you wrote a temporary test file during the investigation, remove only that known file after the run. Do not use a broad wildcard in a project directory. The examples above create no persistent files, so there is nothing to undo.

Done means

  • The interpreter version and architecture are recorded.
  • The script's relevant 5.8.3-era assumptions have a focused test.
  • Tied-hash scalar context is understood as tie-specific behaviour.
  • prove and find2perl availability has been checked instead of assumed.
  • Any failure is tied to a test, module, platform or interpreter version rather than labelled a generic Perl problem.