I've now added checking of use constant { ... } to Perl::MinimumVersion as 5.8.0.

Let me know if this works ok for you.

Adam K

Adam Kennedy wrote:
Eric Wilhelm wrote:
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.)

Never ever heard of that use of use constant to be honest.

So you've found at least one patch-worth (or commit bit worthy) addition, and by the sound of it on possible bug as well.

Wanna fix that?

Adam K

Reply via email to