Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • On behalf of all the Perl::Critic committers I say thanks, Adam. I just committed a fix to Perl::Critic that makes it pass tests with PPI SVN head.

    An anecdote: Perl parses "-t" aggressively. Consider the following code:
        3-t(); # syntax error
        3-test(); # Undefined subroutine &main::test

    PPI doesn't treat the first case the same way Perl does, but it's a syntax error so does it really matter?
    • by Alias (5735) on 2006.09.03 2:48 (#49750) Homepage Journal
      My standard for that is based on how stable Perl's interpretation is.

      Perl's intepretation changes over time (each version has slight differences here and there). Witness how selfgol only works on a few particular versions of Perl.

      PPI doesn't try to maintain bug for bug compatibility, because it simply can't. It has to be somewhat compatible with all versions.

      So the general direction is that BOTH of $Perl{perl} and $Perl{PPI} trends towards $Perl{Larry}. On the way, $Perl{PPI} also tries to get as close as it can to $Perl{perl} but without compromising its compatibility to $Perl{Larry}.

      In the above case, it might matter enough to make it worth it, if not in that case, then maybe in a few other cases.

      It depends on if it is considered a bug or not, one could thing of the above as

      3 -t scalar()

      It is nonsensical, but tentatively legal in some cases.

      If in doubt, I'm inclined to just leave things as they are until something comes up that matters.

      • Sorry, I was unclear. I didn't mean that "3-t();" anecdote as a criticism of PPI. I just thought I'd mention it here as an oddity that I came across in my testing rather than ignore it. It's just a curiosity.
        • And I didn't take it as a criticism, I was just pointing out I know there's lots of stuff like that, and there are certain conditions under which I fix them, even if illogical.