# from Greg Matheson
# on Saturday 24 February 2007 09:02 pm:

>I got one failure with 5.6.2 and passes with 5.8. The problem
>appears to be the constant pragma, which doesn't seem to have an
>independent contemporary existence on CPAN.

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

>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.  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.  Not sure if Adam has anything in 
mind for that.  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.)

While installing 5.6.2 is no walk in the park with my current compilers 
and such, I was able to copy constant.pm from the source tree into an 
active path and verify that issue with 5.8.4.  Maybe an interesting 
smoke project to test against pure-perl core modules from older 
versions?

--Eric
-- 
"You can't win. You can't break even. You can't quit."
--Ginsberg's Restatement of the Three Laws of Thermodynamics
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to