Skip Menu |

This queue is for tickets about the CPANPLUS CPAN distribution.

Report information
The Basics
Id: 3037
Status: resolved
Priority: 0/
Queue: CPANPLUS

People
Owner: Nobody in particular
Requestors: schwern [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.042
Fixed in: (no value)



Subject: CPANPLUS::Configure has bad $VERSION
The following is my answer to an email about a possible MakeMaker problem. In the process of answering that I discovered that the $VERSION in CPANPLUS/Configure.pm is poorly done. Show quoted text
> I've also started getting this error in 'cpan' ONLY: > > Could not eval ' > package ExtUtils::MakeMaker::_version; > no strict; > > local $VERSION; > $VERSION=undef; do { > \$VERSION = $CPANPLUS::Internals::VERSION; > }; $VERSION > ' in /usr/local/lib/perl5/site_perl/5.8.0/CPANPLUS/Configure.pm: Can't modify single ref constructor in scalar assignment at (eval 110) line 7, at EOF
This I can reproduce and its unrelated to the MM_VMS problem above. That's a bug in CPANPLUS::Configure. In fact, there's several of them. They do this: \$VERSION = $CPANPLUS::Internals::VERSION; Which, AFAIK, shouldn't work: ~ $ perl -wle '$Foo::VERSION = 42; \$VERSION = $Foo::VERSION; print $VERSION' Can't modify single ref constructor in scalar assignment at -e line 1, near "$Foo::VERSION;" Execution of -e aborted due to compilation errors. So the error is legit. What they should try instead is: *VERSION = \$CPANPLUS::Internals::VERSION; but there's *another* bug in there. That CPANPLUS::Internals is never loaded by CPANPLUS::Internals! More than likely it just happens to be working because whenever they load CPANPLUS::Configure they also happen to have CPANPLUS::Internals loaded. And since MakeMaker has to see all the information necessary to figure out the version on one line... require CPANPLUS::Internals; *VERSION = \$CPANPLUS::Internals::VERSION; though it kinda sucks to have to load up one module to figure out the version of another. In which case I'd recommend just copying the version # out of CPANPLUS::Internals and pasting it into Configure. Or decoupling the version # of the two as I don't see any obviousl reason why they have to be the same. But its *still* not correct because if you look at CPANPLUS/Configure.pm you'll see that this is in fact the $VERSION for CPANPLUS::Config! CPANPLUS::Configure has no $VERSION. So the above should be moved into the CPANPLUS::Configure package and CPANPLUS::Config should simply say: *VERSION = \$CPANPLUS::Configure::VERSION;
Date: Sun, 27 Jul 2003 16:02:07 +0200
Subject: Re: [cpan #3037] CPANPLUS::Configure has bad $VERSION
From: "Jos I. Boumans" <kane [...] dwim.org>
To: bug-CPANPLUS [...] rt.cpan.org
RT-Send-Cc:
On Friday, Jul 25, 2003, at 07:09 Europe/Amsterdam, Michael_G_Schwern via RT wrote: Show quoted text
> The following is my answer to an email about a possible MakeMaker > problem. In the process of answering that I discovered that the > $VERSION in CPANPLUS/Configure.pm is poorly done. > >
>> I've also started getting this error in 'cpan' ONLY: >> >> Could not eval ' >> package ExtUtils::MakeMaker::_version; >> no strict; >> >> local $VERSION; >> $VERSION=undef; do { >> \$VERSION = $CPANPLUS::Internals::VERSION; >> }; $VERSION >> ' in >> /usr/local/lib/perl5/site_perl/5.8.0/CPANPLUS/Configure.pm: Can't >> modify single ref constructor in scalar assignment at (eval 110) line >> 7, at EOF
> > This I can reproduce and its unrelated to the MM_VMS problem above. > > That's a bug in CPANPLUS::Configure. In fact, there's several of them. > They do this: > > \$VERSION = $CPANPLUS::Internals::VERSION;
we do this in a HEREdoc: my $msg = <<_END_OF_CONFIG_; ############################################ ### CPANPLUS::Config.pm ### ### Configuration structure for CPAN++ ### ############################################ #last changed: $time GMT package CPANPLUS::Config; \$VERSION = $CPANPLUS::Internals::VERSION; </code> this means it's a bug in EU::MM that it tries to parse $VERSION in a quoted string. We are generating CPANPLUS::Config dynamically, and the way to tell if your old config (from a possibly previous install) is still valid depends on the version. the way to print a literal $ in the HEREdoc is by prefixing it with a \ -- Jos Boumans "Cocaine is God's way of telling you you make too much money" CPANPLUS http://cpanplus.sf.net
fixed @ 7725, which will be in 0.043