in reply to Re^3: Only perl parses perl hash notation?
in thread Only perl parses perl hash notation?

As with many things in the Unix universe, the saying, "Nothing can parse Perl except perl" is case-sensitive. The saying means, "Nothing can parse the language of Perl except the executable called perl."

The Windows equivalent would be: "Nothing can parse Perl except PERL.EXE."

The saying is NOT trying to suggest that a Perl script can flawlessly parse Perl language snippets. That is a common misconception and misunderstanding. A parser written in Perl can do a lot, but any parser you're likely(*) to write in Perl will fail to parse all of the Perl language.

The wisdom in this koan is to realize that the Perl language is so crufty with special-cases and funky exceptions to its own grammars that it would be folly to try to parse any Perl script by writing a parser from scratch. Even the human brain can't always parse Perl in many cases. You'll get hung up on the many years of grammar evolution.

(*) Unless you're implementing Perl6, which is really just using Perl6 to plan Perl6.

--
[ e d @ h a l l e y . c c ]

  • Comment on Re^4: Only perl parses perl hash notation?

Replies are listed 'Best First'.
Re^5: Only perl parses perl hash notation?
by BrowserUk (Patriarch) on Oct 05, 2004 at 13:46 UTC
    The Windows equivalent would be: "Nothing can parse Perl except PERL.EXE."

    Funnily enough, my Perl executable is named 'perl.exe'.

    The nice thing is though--just as in english where 'The', 'the', 'THE', 'tHe' etc. all have the same meaning, though some are more acceptable than others in some circumstances--I can type 'Perl', 'perl', 'PERL', the classic 'pERL', or any other combination and they all find my executable. Neat huh.

    I guess you could set up 15 alias' or symlinks :).


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      An interesting aside, I suppose, but doesn't seem particularly germaine to the discussion.

      I never claimed Windows was case-sensitive, although it is (mostly) case-preserving. I merely said that like Unix, the adage depends on the use of the distinction between capital and lowercase letters to impart its full meaning.

      It's okay, sometimes I wake up grouchy and decide to be a contrarian just for the sake of disagreeing with people on the tiniest of nits, too.

      --
      [ e d @ h a l l e y . c c ]

        You know, I've read and re-read what I wrote, and I still think it's funny (as was intended), rather than grouchy or contrarian.

        It's true that I happen to think that case-preserving case insensitivity makes more sense than full case sensitivity for filesystems, and even language identifiers, but it was originally meant as humour rather than any sort of serious dig at that other OS. There's even a smiley in there somewhere. Oh well.


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "Think for yourself!" - Abigail
        "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      -just as in english where 'The', 'the', 'THE', 'tHe' etc. all have the same meaning

      "tHe" is not English! "The" and "the" also have different meanings, "The" indicates the start of a sentence!

      Case-sensitivity also matters elsewhere in English, consider the implications of "He" vs "he" when talking about God.

        "The" indicates the start of a sentence!

        No, the presence of a capital letter on the first of a connected group of words terminated with a full stop indicates the start of a sentence. Do you start every sentence with 'The'?

        The meaning of the capitalised word doesn't change. When my CLI is capable of deriving meaning from my typing sentences at it, then case might be a useful semantic, but until then it's just inconvenient.

        Unless you have a good use for having seperate commands: perl, Perl, PErl, PERl, PERL, pErl, pERl, pERL, perL, peRL, PeRl, pErL?

        If so, you'll spot the 4 missing useful commands instantly?

        As for the implications of the other matter--do you think hE would be bothered? Or is it only man that gives import to such matters?


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "Think for yourself!" - Abigail
        "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
Re^5: Only perl parses perl hash notation?
by SpanishInquisition (Pilgrim) on Oct 05, 2004 at 13:53 UTC
    <Wassercats><Joke>

    So I should abandon my Perl 4 interpreter project that is to be completely written in Perl 5 then? Many people want Perl 4 these days and only Perl 5 comes installed on systems so this seemed like a good way to get them want they wanted. If there are any Perl 5 modules for parsing Perl 4 (or Perl 3) let me know and maybe we can fix this situation.

    </Wassercats></Joke>