Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Bug in Module::Info? our vs. use vars (local our)

by Athanasius (Archbishop)
on Jan 16, 2016 at 09:05 UTC ( [id://1152922]=note: print w/replies, xml ) Need Help??


in reply to Re: Bug in Module::Info? our vs. use vars (local our)
in thread Bug in Module::Info? our vs. use vars

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,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^3: Bug in Module::Info? our vs. use vars (local our)
by Anonymous Monk on Jan 16, 2016 at 09:27 UTC
    :) solution is simple, eliminate any "our", don't do "our" in inner blocks of eval, our $VERSION; local $VERSION; is adequate, you don't have to use local our $VERSION;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1152922]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found