Skip to content

Commit

Permalink
be stricter in when finding packages in files
Browse files Browse the repository at this point in the history
This will prevent us from finding a package in this line of code:

  my $x = "package Foo;";

This manifested in the wild in PRBRENAN/Math-Algebra-Symbols-1.21.tar.gz
  • Loading branch information
rjbs authored and andk committed Apr 25, 2024
1 parent a0a7c5e commit 0daf9c3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/PAUSE/pmfile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,16 @@ sub packages_per_pmfile {

if (
$pline =~ m{
(.*)
(?<![*\$\\@%&]) # no sigils
\bpackage\s+
^
[\s\{;]*
package
\s+
([\w\:\']+)
\s*
(?: $ | [\}\;] | \{ | \s+($version::STRICT) )
}x) {
$pkg = $2;
$strict_version = $3;
$pkg = $1;
$strict_version = $2;
if ($pkg eq "DB"){
# XXX if pumpkin and perl make him comaintainer! I
# think I always made the pumpkins comaint on DB
Expand Down

0 comments on commit 0daf9c3

Please sign in to comment.