Subject: | Devel::FindAmpersand fails to detect uses of evil variables in BEGIN blocks |
Date: | Tue, 24 Nov 2015 11:15:35 -0700 |
To: | bug-Devel-SawAmpersand [...] rt.cpan.org |
From: | Maxwell Carey <mcarey [...] ucar.edu> |
Devel::FindAmpersand fails to detect uses of evil variables in BEGIN blocks:
$ perl -MDevel::FindAmpersand -e'BEGIN { $& }'
$ perl -MDevel::FindAmpersand -e'$&'
Found evil variable $& in file -e, line 1
Consequently, it also fails to detect use of modules that use evil
variables:
$ perl -MDevel::FindAmpersand -e'use English'
$
Devel::SawAmpersand, on the other hand, works as expected:
$ perl -MDevel::SawAmpersand=sawampersand -e'BEGIN { $& } warn if
sawampersand'
Warning: something's wrong at -e line 1.
$ perl -MDevel::SawAmpersand=sawampersand -e'use English; warn if
sawampersand'
Warning: something's wrong at -e line 1.