Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Pre/post subroutine assertions and documentation module?

by educated_foo (Vicar)
on Jan 12, 2012 at 17:29 UTC ( #947587=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://947587]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2022-09-27 20:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (124 votes). Check out past polls.

    Notices?