John Peacock wrote:
Ahhh, it is this code from CPAN.pm (being these are lines 4 and 5):

    $CPAN::VERSION = '1.8801';
    $CPAN::VERSION = eval $CPAN::VERSION;

OK, I have it sussed out, but I'm not sure how to fix it yet for the general case. The issue only comes up when you use fully-qualified $Package::VERSION assignments because of the way that Module::Build::ModuleInfo is coded.

Here's the sequence of events:

1) the first line is scanned, eval'd, and correctly assigns a hash element mapping the module to the version.

2) the second line is scanned and eval'd *in isolation* and cannot access the previous line's assignment, so it both fails to "eval" and also notes that the $VERSION has already been assigned.

The short-term fix is that putting those two lines on a single line:

        $CPAN::VERSION = '1.8801'; $CPAN::VERSION = eval $CPAN::VERSION;

correctly operates (i.e. doesn't warn and doesn't complain about duplicate assignment). I'm not sure how to augment the code in Module::Build::ModuleInfo to handle this relatively common case.

John

--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

Reply via email to