Skip to content

Commit

Permalink
regen/HeaderParser.pm - friendly perl version check
Browse files Browse the repository at this point in the history
If the installed version of perl is too old then HeaderParser.pm
will die because it uses named capture buffers. We could do a "standard"
version assertion, but doing it this way makes for a more user friendly
error message.
  • Loading branch information
demerphq committed Jul 16, 2023
1 parent 8224302 commit 8906221
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions regen/HeaderParser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ package HeaderParser;
use strict;
use warnings;

BEGIN {
if ($] < 5.010) {
die <<EOFMSG;
The regen code in the perl repo needs at least version 5.10 to run.
You are currently using $], we recommend you install a more modern
version of perl before you try to build this version of perl.
EOFMSG
}
}

# these are required below in BEGIN statements, we cant have a
# hard dependency on them as they might not be available when
# we run as part of autodoc.pl
Expand Down

0 comments on commit 8906221

Please sign in to comment.