Re: [Module::Build] Buglet: Creative use of $VERSION confuses M::B
Status: Beta
Brought to you by:
kwilliams
|
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-28 08:47:20
|
On Mon, Mar 27, 2006 at 04:07:24PM +0100, Nick Ing-Simmons wrote:
> Johan Vromans <jvr...@sq...> writes:
> >The following sequence of statements (copied from Config::IniFiles
> >2.38) confuses the version number detection:
> >
> > package Config::IniFiles;
> > $Config::IniFiles::VERSION = (qw($Revision: 2.38 $))[1];
> > require 5.004;
> > use strict;
> > # Eliminate annoying warnings
> > if ($^W) {
> > $Config::IniFiles::VERSION = $Config::IniFiles::VERSION;
> > }
> >
> >This causes the following message:
> >
> > Package 'Config::IniFiles' already declared with version '2.38'
> > ignoring new version ''.
>
> The "creative use" being the assigning it to itself rather
> than using 'our' or 'use vars' to mark it as not subject to
> 'used only once' warning?
>
> Would writing if on one line:
>
> if ($^W) { $Config::IniFiles::VERSION = $Config::IniFiles::VERSION; }
>
> Suffice to hide it from the pseudo-parser?
If the goal is to get Config::IniFiles to work with M::B rather than the
other way around, best just to make it:
$Config::IniFiles::VERSION = $Config::IniFiles::VERSION = (qw($Revision: 2.38 $))[1];
in the first place.
|