local our works
Yes, it works without warnings provided there is no our inside the do block. But that our comes from the external module being examined (Capture::Tiny in my examples), and when that our is present a warning is generated:
18:47 >perl 1513_SoPW.pl
"our" variable $VERSION redeclared at (eval 1) line 4.
(Did you mean "local" instead of "our"?)
Version: desired_version
18:47 >p5u v Capture::Tiny
Capture::Tiny
"our" variable $VERSION redeclared at (eval 49) line 7, <MOD> line 6.
(Did you mean "local" instead of "our"?)
C:\Perl\Strawberry\strawberry-perl-5.22.1.1-64bit-PDL\perl\ven
+dor\lib\Capture\Tiny.pm: 0.30
18:47 >
Thanks for the links. I’ve read 'our' is not 'my'; local our $var; What does it do? is interesting, but local our wouldn’t be suitable as a patch, anyway, because (judging by the use 5.006 pragma) Module::Info is intended to be backwards-compatible as far back as Perl 5.6.
Cheers,
|