in reply to Re^3: matching POD footnote
in thread matching POD footnote

this is an exercise

no parsing modules allowed :(

Replies are listed 'Best First'.
Re^5: matching POD footnote
by tobyink (Canon) on Jul 18, 2013 at 09:04 UTC

    OK, that's a good reason.

    I was expecting you to say that you were unable to install any modules (for some reason), in which case I'd counter with the fact that Pod::Parser comes pre-installed with Perl.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
      :)
Re^5: matching POD footnote (updated)
by LanX (Saint) on Jul 18, 2013 at 09:54 UTC
    I have to say, a very stupid exercise!

    you can only show how to write either incomplete or redundant code.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

    UPDATE

    to answer AnoMonk:

    Duplicating the POD-grammar in a separate parser is practically the same sin like writing a source filter for Perl code.

    So either incomplete or redundant code, like already said!

      I have to say, a very stupid exercise! you can only show how to write incomplete or redundant code.

      And how does that make it a stupid exercise?

      Duplicating the POD-grammar in a separate parser is practically the same sin like writing a source filter for Perl code.

      So either incomplete or redundant code, like already said!

      What would you assign as an exercise to learn lexing/parsing? Would you invent a format, or would that be equally sinful?

        An example which doesn't manipulate nested constructs in the input, then supposed to be processed by another parser.

        Like extracting nested constructs from HTML ...¹

        Telling a student to reinvent a complete POD-parser is hardly a good exercise.

        Or did you show us an intelligent or at least working solution?

        Cheers Rolf

        ( addicted to the Perl Programming Language)

        Update

        ¹) Or replacing simple constructs in POD.