From 355103d5873351b491db96e0b432d3c00de67b09 Mon Sep 17 00:00:00 2001
From: Jan Palus <jpalus@fastmail.com>
Date: Wed, 5 Jul 2023 12:12:06 +0200
Subject: [PATCH 2/2] perl: detect files with version after package name

as per https://perldoc.perl.org/functions/package perl allows to give
version after package name so in addition to:

package <package-name>;

add support for detecting:

package <package-name> <version>;

where <version> is version string consisting of numbers and dotts,
optionally prefixed with 'v'. Examples:

v1.2.3
1.0
---
 magic/Magdir/perl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/magic/Magdir/perl b/magic/Magdir/perl
index db1d633e..d4e8080e 100644
--- a/magic/Magdir/perl
+++ b/magic/Magdir/perl
@@ -34,11 +34,11 @@
 # by Dmitry V. Levin and Alexey Tourbin
 # check the first line
 0	search/8192	package
->0	regex		\^package[[:space:]]+[0-9A-Za-z_:]+[[:space:]]*;	Perl5 module source text
+>0	regex		\^package[[:space:]]+[0-9A-Za-z_:]+[[:space:]]*([[:space:]]v?[0-9][0-9.]*)?[[:space:]]*;	Perl5 module source text
 !:strength + 40
 # not 'p', check other lines
 0	search/8192	!p
->0	regex		\^package[[:space:]]+[0-9A-Za-z_:]+[[:space:]]*;
+>0	regex		\^package[[:space:]]+[0-9A-Za-z_:]+[[:space:]]*([[:space:]]v?[0-9][0-9.]*)?[[:space:]]*;
 >>0	regex		\^1[[:space:]]*;|\^(use|sub|my)[[:space:]].*[(;{=]	Perl5 module source text
 !:strength + 75
 
-- 
2.41.0

