http://qs321.pair.com?node_id=947587


in reply to Pre/post subroutine assertions and documentation module?

Smart::Comments may help -- what do you mean by "documentation"? POD? Comments? Code examples?
  • Comment on Re: Pre/post subroutine assertions and documentation module?

Replies are listed 'Best First'.
Re^2: Pre/post subroutine assertions and documentation module?
by suaveant (Parson) on Jan 12, 2012 at 17:58 UTC
    I want something that verifies incoming parameters (usually a hash ref, so sub-keys) are correct, and also is designed in such a way that a short blurb can be added for viewing/extracting that describes the inputs.

    It seems an obvious conjoining, if you are verifying inputs why not also document them, or vice versa. I may end up using something like Smart::Comments/Getopt::Euclid as a starting point for something of my own.

                    - Ant
                    - Some of my best work - (1 2 3)

      These subs... are they intended to be called as functions, or as methods? If the latter, then something like Method::Signatures, or MooseX::Declare might be an idea.

        Methods AND subs, this is something I want to start applying to existing code, so switching to Moose is probably beyond scope.

                        - Ant
                        - Some of my best work - (1 2 3)

        something like Method::Signatures, or MooseX::Declare might be an idea.
        You mean "a terrible idea," right? Whether they're "functions" or "methods" (i.e. "functions where the type of the first argument determines the function to be called"), verifying input and output is the same.