Thanks for the responses to my question about a failure on 5.6.2,
due to changes in constant.pm

On Sun, 25 Feb 2007, Eric Wilhelm wrote:

> It isn't dual-lifed, but at least the docs for the old version are 
> available.  Just lookup perl on search.cpan.org and then select an 
> older version.  That confirms your suspicion.

>   http://search.cpan.org/~rgarcia/perl-5.6.2/lib/constant.pm

I need to learn how to find older versions. Just searching for
perl only brings up 5.8.8.

http://search.cpan.org/~nwclark/perl-5.8.8/
http://search.cpan.org/~jhi/perl-5.8.1/

It looks like not all perl releases are on CPAN. It looks like it
helps if I know who the pumpkins were.

Wait. I can click on Other Releases!

> >How do you find out what can be done in older perls?

> I've heard about Perl::MinimumVersion, though it doesn't seem to catch 
> this case in the little test I just tried.

It told me 5.6 was ok, running it on my module too.

> Looking at the source, it certainly seems like it could handle it, though I
> suspect it would be a good idea to source all of that juicy expert knowledge
> from data files rather than embedding it in code.  

In the check for 5.5 modules it fingers base, Tie::Array, and
Exception, Thread, and Error modules as ones using techniques
that are version dependent. Which seems to be the same problem as
here.

> Anyway, some digging suggests this might catch it:

>   $doc->find_any(sub {
>     $_[1]->isa('PPI::Statement::Include') and
>     $_[1]->schild(2)->isa('PPI::Structure::Block')
>   });

> Though that could also be a list containing a block (which is actually a 
> hashref, but those don't seem to be distinguished.)

It'd be pretty hard to get that right, seeing as perl itself
doesn't get it right all the time.

> I was able to copy constant.pm from the source tree into an 
> active path and verify that issue with 5.8.4.

That is the resourceful way. I should have thought of that.

> Maybe an interesting smoke project to test against pure-perl
> core modules from older versions?

I confirmed 5.8.0 is okay.


On Sun, 25 Feb 2007, imacat wrote:

> I believe most of the cpan-testers readers does like me, since
> I have no problem discuss with others there.  So I suggest you
> still post this onto cpan-testers..

I got a reply from David Cantrell, the tester who caught the
problem, who gave some advice similar to that on this list.

The volume of testing reports has increased in the last couple of
years.


On Sun, 25 Feb 2007, Sébastien Aperghis-Tramoni wrote:

> Indeed, the constant pragma began supporting this feature with Perl 5.8

> If you want your module to be compatible with Perl 5.6, you can  
> rewrite your statement using multiple "use constant" calls.  
> Otherwise, you can simply add a "require 5.008" in your Makefile.PL  
> in order to indicate that your module needs Perl 5.8.

Rewriting is not difficult, even though it does not look good.
Requiring 5.8 might restrict its use.


On Sun, 25 Feb 2007, Andy Armstrong wrote:

> Archaeology: this seems to be the birth of use constant:

> http://backpan.hexten.net/authors/id/P/PH/PHOENIX/constant-0.01.readme

It looks like it was taken over from him very quickly.


On Sun, 25 Feb 2007, Jerry D. Hedden wrote:

> 5.6.2 is available here:  http://search.cpan.org/~rgarcia/perl-5.6.2/

> I built it under Solaris and use it for testing my modules.

That's going the extra mile, more than I want to do.


On Mon, 26 Feb 2007, A. Pagaltzis wrote:

> >     use constant {
> >         C1        => 'C1',

> Write the same thing without syntactic sugar from constant.pm.

>     sub C1     () { 'C1' }

Mmh. I see constant.pm does very little. Perl::MinimumVersion
uses the sub with the empty prototype too.

-- 
Greg Matheson         In theory, theory and practice are the same thing.
                      In practice, they are different.
                      --Jan LA van de Snepscheut

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to